Skip to contentSkip to conversation

Fix pad button definition in hid-wacom.c

PATCH Applied Przemysław Firszt 4 participants 7 messages Jan 3, 2010 – Jan 12, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix pad button definition in hid-wacom.c

Hi,
Please check attached patch and apply if it's possible. The patch was also discussed here:
http://www.mail-archive.com/[email protected]/msg00128.htm

--
Regards,
Przemo Firszt

Quoted 1 line

From 63d3fd45f4ef9e02a1073f1c8b1adf226ac66cf3 Mon Sep 17 00:00:00 2001

From: Przemo Firszt <[email protected]>
Date: Sun, 3 Jan 2010 18:31:31 +0000
Subject: [PATCH] Fix pad button definition in hid-wacom.c

This fix is required for xorg driver to recognise 2 pad buttons

---
 drivers/hid/hid-wacom.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/hid/hid-wacom.c +3 -0
index 7475421..75ea66a 100644
@@ -196,6 +196,9 @@ static int wacom_probe(struct hid_device *hdev,
 	/* Pad */
 	input->evbit[0] |= BIT(EV_MSC);
 	input->mscbit[0] |= BIT(MSC_SERIAL);
+	set_bit(BTN_0, input->keybit);
+	set_bit(BTN_1, input->keybit);
+	set_bit(BTN_TOOL_FINGER, input->keybit);
 
 	/* Distance, rubber and mouse */
 	input->absbit[0] |= BIT(ABS_DISTANCE);
Signature · 1 line
1.6.5.7
#2 lore raw
Quoted 7 lines · Jiri Kosina
Quoted 3 lines · Przemysław Firszt

Please check attached patch and apply if it's possible. The patch was also discussed here:
http://www.mail-archive.com/[email protected]/msg00128.htm

Adding Bastien (the author of hid-wacom.c) to CC.

I'm on the list already :)

Quoted 1 line

I have queued the patch in my tree, thanks.

Looks good, thanks for the patch!

Cheers

#3 lore raw

Dnia 2010-01-04, pon o godzinie 16:39 +0100, Bastien Nocera pisze:

Quoted 8 lines · Jiri Kosina
Quoted 7 lines · Przemysław Firszt
Quoted 4 lines

Please check attached patch and apply if it's possible. The patch was also discussed here:
http://www.mail-archive.com/[email protected]/msg00128.htm

Adding Bastien (the author of hid-wacom.c) to CC.

[..]
There is one more change required to get the pad buttons on wacom bluetooth tablet fully working - see attached patch.
My main goal was to map pad buttons to Ctrl-Z and Ctrl-Y - (gimp undo/redo) and now it works.
After this:
xsetwacom --set "WACOM Pen Tablet pad" Button1 "core key ctrl z" xsetwacom --set "WACOM Pen Tablet pad" Button2 "core key ctrl y" I've got nicely working undo/redo in gimp.
--
Przemo

Quoted 1 line

From 28feba89f364fc7ce0733ca9736b970bcdde7fd3 Mon Sep 17 00:00:00 2001

From: Przemo Firszt <[email protected]>
Date: Sat, 9 Jan 2010 13:58:51 +0000
Subject: [PATCH 2/2] Add BTN_TOOL_FINGER input report when reporting a pad button

Without this patch xf86-input-wacom driver wasn't able to properly recognise pad button events. It was also causing some problems with button mapping.

---
 drivers/hid/hid-wacom.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hid/hid-wacom.c +1 -0
index 75ea66a..12dcda5 100644
@@ -142,6 +142,7 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
 		wdata->butstate = rw;
 		input_report_key(input, BTN_0, rw & 0x02);
 		input_report_key(input, BTN_1, rw & 0x01);
+		input_report_key(input, BTN_TOOL_FINGER, 0xf0);
 		input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
 		input_sync(input);
 	}
Signature · 1 line
1.6.5.7
Applied
#4 lore raw
Quoted 2 lines · Przemysław Firszt

There is one more change required to get the pad buttons on wacom bluetooth tablet fully working - see attached patch.

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#5 lore raw

2010/1/9 Jiri Kosina <[email protected]>:

Quoted 11 lines · On Sat, 9 Jan 2010, Przemys=C5=82aw Firszt wrote:
Quoted 3 lines

There is one more change required to get the pad buttons on wacom bluetooth tablet fully working - see attached patch.

Applied, thanks.

--
Jiri Kosina
SUSE Labs, Novell Inc.

The patch below is needed for Wacom X.Org driver to receive the proper PAD button events. It is based on Przemo's applied patch attached to this email sting.

hid-wacom.c renamed from hid-wacom.c_old +3 -0
@@ -197,6 +197,9 @@
 	/* Pad */
 	input->evbit[0] |=3D BIT(EV_MSC);
 	input->mscbit[0] |=3D BIT(MSC_SERIAL);
+	set_bit(BTN_0, input->keybit);
+	set_bit(BTN_1, input->keybit);
+	set_bit(BTN_TOOL_FINGER, input->keybit);
 
 	/* Distance, rubber and mouse */
 	input->absbit[0] |=3D BIT(ABS_DISTANCE);
#6 lore raw
Quoted 12 lines · Ping
Quoted 2 lines
Quoted 2 lines

There is one more change required to get the pad buttons on wacom bluetooth tablet fully working - see attached patch.

The patch below is needed for Wacom X.Org driver to receive the proper PAD button events. It is based on Przemo's applied patch attached to this email sting.

hid-wacom.c line 205

Quoted 9 lines
hid-wacom.c renamed from hid-wacom.c_old +3 -0
@@ -197,6 +197,9 @@
 	/* Pad */
 	input->evbit[0] |= BIT(EV_MSC);
 	input->mscbit[0] |= BIT(MSC_SERIAL);
+	set_bit(BTN_0, input->keybit);
+	set_bit(BTN_1, input->keybit);
+	set_bit(BTN_TOOL_FINGER, input->keybit);
 
 	/* Distance, rubber and mouse */
 	input->absbit[0] |= BIT(ABS_DISTANCE);

Hi,

thanks for the patch. Przemo has already submitted this exact fix already, and I have it queued in my tree.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.