2008. június 4.

How to get the 3 onscreen tablet buttons working?

ATTENTION! THIS POST IS OUTDATED!

1. Download the latest LinuxWacom.
2. Install the following packages through Synaptic:
  • tcl8.4
  • tcl8.4-dev
  • tk8.4
  • tk8.4-dev
  • xserver-xorg-dev
  • libncurses5-dev
...and dependancies.

3. Unpack the linuxwacom tar.gz
4. Modify the /src/xdrv/wcmISDV4.c as follows (add the lines in blue):
/* Coordinate data bit check */
if (data[0] & 0x40)
{
if ((int)data[0] == 0xc1)
{
if (data[1] & 0x07)
{
ds = &common->wcmChannel[0].work;
/* Now fool it into thiking it's in proximity */
ds->proximity = 1;
ds->buttons = ((data[1] & 0x07) << 3);
xf86WcmEvent(common,0,ds);
}
}
return common->wcmPktLength;
}
}
5. Modify the src/xdrv/wcmCommon.c as follows (one change in blue)
/*****************************************************************************
* xf86WcmSendButtons --
* Send button events by comparing the current button mask with the
* previous one.
****************************************************************************/

static void xf86WcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry,
int rz, int v3, int v4, int v5)
{
int button, mask, bsent = 0;
WacomDevicePtr priv = (WacomDevicePtr) local->private;
WacomCommonPtr common = priv->common;
DBG(6, priv->debugLevel, ErrorF("xf86WcmSendButtons "
"buttons=%d for %s\n", buttons, local->name));

/* Tablet PC buttons. */
if ( common->wcmTPCButton && !IsCursor(priv) && !IsPad(priv) && !IsEraser(priv) )
{
if ( buttons & 57 )
{
if ( !(priv->flags & TPCBUTTONS_FLAG) )
{
priv->flags |= TPCBUTTONS_FLAG;

bsent = 0;

/* send all pressed buttons down */
for (button=2; button<=MAX_BUTTONS; button++) { mask = 1 << (button-1); if ( buttons & mask ) { bsent = 1; /* set to the configured button */ sendAButton(local, button-1, 1, rx, ry, rz, v3, v4, v5); } }
6. Go to the folder in the Terminal and type:
./configure
sudo make
7. Now you should have a wacom_drv.so in the /src/xdrv directory. Make a backup of your old wacom_drv.so:

sudo mv /usr/lib/xorg/modules/input/wacom_drv.so /usr/lib/xorg/modules/input/wacom_drv.so.bak
and copy the new one over:

cd src/xdrv
sudo cp wacom_drv.so /usr/lib/xorg/modules/input/wacom_drv.so
8. Edit your profile:
sudo nano /etc/profile

# enable buttons on HP TC4400
xsetwacom set stylus Button2 "3"
xsetwacom set stylus Button4 "core key shift F1"
xsetwacom set stylus Button5 "core key shift F2"
xsetwacom set stylus Button6 "core key shift F3"

9. Reboot.

10. Set the global keybindings and keybinding commands in the Configuration Editor /Apps /Metacity:
Global Keybindings:
run_command_1 F1
run_command_2
F2
run_command_3
F3

Keybinding Commands:
command_1 xournal
command_2 sh /usr/bin/rotate.sh
command_3 [onscreen keyboard - I don't use it yet]
------------
Thanks to Ubuntu Forum Community.

Nincsenek megjegyzések: