aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentUpdate autogen.sh to one that does objdir != srcdir. (diff)
downloadxf86-input-evdev-ce0cafa1151841b46dedce616472cf5f38ffde83.tar.gz
xf86-input-evdev-ce0cafa1151841b46dedce616472cf5f38ffde83.tar.bz2
xf86-input-evdev-ce0cafa1151841b46dedce616472cf5f38ffde83.zip
Bug #3913: Suppress kernel-generated repeat events for chording keys.XORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901
Diffstat (limited to 'src')
-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;