Compare commits

..

1 commit

Author SHA1 Message Date
Peter Hutterer
2a328ce333 Don't detect multimedia keyboards as joysticks (#1194469) 2015-02-26 17:28:39 +10:00
4 changed files with 118 additions and 978 deletions

9
.gitignore vendored
View file

@ -1 +1,8 @@
/libinput-*.tar.bz2
/libinput-0.1.0.tar.xz
/libinput-0.2.0.tar.xz
/libinput-0.4.0.tar.xz
/libinput-0.5.0.tar.xz
/libinput-0.6.0.tar.xz
/libinput-20141124.tar.xz
/libinput-0.7.0.tar.xz
/libinput-20141211.tar.xz

View file

@ -0,0 +1,74 @@
From 5f848ea35757dde7847d11464a7fec106a4a30f9 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 21 Jan 2015 12:04:48 +0100
Subject: [PATCH libinput] evdev: Be more careful about what we consider a
joystick
After switching my main workstation over to using xf86-input-libinput, I
noticed that the multi-media keys like play/pause on my keyboard no longer
worked.
It turns out that the second hid interface on my keyboard which has the
multimedia-keys, also declares having: BTN_BASE6 and BTN_MODE which both
fell into the range we were using to test for something being a joystick.
The commit makes our joystick test mode strict, restoring functionality
of the multi-media keys on the keyboard in question.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0afd0b792fb9c244442ac4532ceeaa9565dd1928)
---
src/evdev.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/evdev.c b/src/evdev.c
index dce035a..7ea7cd6 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1283,7 +1283,7 @@ evdev_configure_device(struct evdev_device *device)
struct libevdev *evdev = device->evdev;
const struct input_absinfo *absinfo;
int has_abs, has_rel, has_mt;
- int has_button, has_keyboard, has_touch;
+ int has_button, has_keyboard, has_touch, has_joystick_button;
struct mt_slot *slots;
int num_slots;
int active_slot;
@@ -1295,17 +1295,24 @@ evdev_configure_device(struct evdev_device *device)
has_abs = 0;
has_mt = 0;
has_button = 0;
+ has_joystick_button = 0;
has_keyboard = 0;
has_touch = 0;
- for (i = BTN_JOYSTICK; i < BTN_DIGI; i++) {
- if (libevdev_has_event_code(evdev, EV_KEY, i)) {
- log_info(libinput,
- "input device '%s', %s is a joystick, ignoring\n",
- device->devname, devnode);
- return -1;
- }
- }
+ for (i = BTN_JOYSTICK; i <= BTN_PINKIE; i++)
+ if (libevdev_has_event_code(evdev, EV_KEY, i))
+ has_joystick_button = 1;
+
+ for (i = BTN_GAMEPAD; i <= BTN_TR2; i++)
+ if (libevdev_has_event_code(evdev, EV_KEY, i))
+ has_joystick_button = 1;
+
+ if (has_joystick_button) {
+ log_info(libinput,
+ "input device '%s', %s is a joystick, ignoring\n",
+ device->devname, devnode);
+ return -1;
+ }
if (libevdev_has_event_type(evdev, EV_ABS)) {
--
2.1.0

File diff suppressed because it is too large Load diff

View file

@ -1 +1,4 @@
SHA512 (libinput-1.30.1.tar.bz2) = 6d9bb5653dfeb0e30c64e92f8146a8908233162ef39f89114f619605b7f0de3f9e0f344412d91c809d3c1dc3d4b836a5709373a80191484db3c6d0a8f69c4f82
3afaf9f66d8796323a79edb879c10ba3 libinput-0.6.0.tar.xz
f63a656eb93117da43302566df0de874 libinput-20141124.tar.xz
381b61396de28c12716ef7a5475fea50 libinput-0.7.0.tar.xz
e632f825162535bac32e9087d8281c7e libinput-20141211.tar.xz