summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-09-23 22:32:23 +0000
committerAdam Jackson <ajax@nwnk.net>2005-09-23 22:32:23 +0000
commitce0cafa1151841b46dedce616472cf5f38ffde83 (patch)
tree959b07d5401c4eb0af6b770d5421960cdd01008c
parent7d5839eb992e0a217b8368762cab80fa7a15faa2 (diff)
Bug #3913: Suppress kernel-generated repeat events for chording keys.XORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901
-rw-r--r--src/evdev.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index f1c7cea..aa1eb5d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -100,6 +100,22 @@ PostButtonClicks(InputInfoPtr pInfo, int button, int count)
}
static void
+PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
+{
+ /* filter repeat events for chording keys */
+ if (value == 2 &&
+ (ev->code == KEY_LEFTCTRL || ev->code == KEY_RIGHTCTRL ||
+ ev->code == KEY_LEFTSHIFT || ev->code == KEY_RIGHTSHIFT ||
+ ev->code == KEY_LEFTALT || ev->code == KEY_RIGHTALT ||
+ ev->code == KEY_LEFTMETA || ev->code == KEY_RIGHTMETA ||
+ ev->code == KEY_CAPSLOCK || ev->code == KEY_NUMLOCK ||
+ ev->code == KEY_SCROLLLOCK)) /* XXX windows keys? */
+ return;
+
+ xf86PostKeyboardEvent(pInfo->dev, ev->code + MIN_KEYCODE, value);
+}
+
+static void
EvdevReadInput(InputInfoPtr pInfo)
{
struct input_event ev;
@@ -170,8 +186,7 @@ EvdevReadInput(InputInfoPtr pInfo)
break;
default:
- xf86PostKeyboardEvent(pInfo->dev,
- ev.code + MIN_KEYCODE, value);
+ PostKbdEvent(pInfo, &ev, value);
}
break;