Hi guys,
Not being a libinput dev I was looking for advice on using this patch.
I noticed that a lot of the RAT config was in /test. After compiling the
driver
and installing it the problem still persists.
I'm assuming it's due to needing a flag when compiling to include /test
components?
Any advice would be great!
Thanks,
Joel
On Fri, Jan 29, 2016 at 12:48 AM, Peter Hutterer
wrote:
> This button sends a release N, press N+1 on each press, cycling through the
> three event codes supported. This causes a stuck button since the current
> mode
> is never released.
>
> Long-term this better served by a set of switches that toggle accordingly,
> for
> now disable the button codes.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=92127
>
> Signed-off-by: Peter Hutterer
> ---
> src/evdev.c| 36 +
> src/evdev.h| 1 +
> test/Makefile.am | 1 +
> test/device.c | 33
> test/litest-device-cyborg-rat-5.c | 71
> ++
> test/litest.c | 2 +
> test/litest.h | 1 +
> udev/90-libinput-model-quirks.hwdb | 7
> udev/90-libinput-model-quirks.rules.in | 4 ++
> 9 files changed, 156 insertions(+)
> create mode 100644 test/litest-device-cyborg-rat-5.c
>
> diff --git a/src/evdev.c b/src/evdev.c
> index 8f0a607..66673a8 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1677,6 +1677,7 @@ evdev_read_model_flags(struct evdev_device *device)
> { "LIBINPUT_MODEL_JUMPING_SEMI_MT",
> EVDEV_MODEL_JUMPING_SEMI_MT },
> { "LIBINPUT_MODEL_ELANTECH_TOUCHPAD",
> EVDEV_MODEL_ELANTECH_TOUCHPAD },
> { "LIBINPUT_MODEL_APPLE_INTERNAL_KEYBOARD",
> EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD },
> + { "LIBINPUT_MODEL_CYBORG_RAT", EVDEV_MODEL_CYBORG_RAT },
> { NULL, EVDEV_MODEL_DEFAULT },
> };
> const struct model_map *m = model_map;
> @@ -2249,6 +2250,39 @@ evdev_drain_fd(int fd)
> }
> }
>
> +static inline void
> +evdev_pre_configure_model_quirks(struct evdev_device *device)
> +{
> + /* The Cyborg RAT has a mode button that cycles through event
> codes.
> +* On press, we get a release for the current mode and a press for
> the
> +* next mode:
> +* E: 0.01 0004 0004 589833 # EV_MSC / MSC_SCAN
> 589833
> +* E: 0.01 0001 0118 # EV_KEY / (null) 0
> +* E: 0.01 0004 0004 589834 # EV_MSC / MSC_SCAN
> 589834
> +* E: 0.01 0001 0119 0001 # EV_KEY / (null) 1
> +* E: 0.01 # SYN_REPORT (0)
> -- +0ms
> +* E: 0.705000 0004 0004 589834 # EV_MSC / MSC_SCAN
> 589834
> +* E: 0.705000 0001 0119 # EV_KEY / (null) 0
> +* E: 0.705000 0004 0004 589835 # EV_MSC / MSC_SCAN
> 589835
> +* E: 0.705000 0001 011a 0001 # EV_KEY / (null) 1
> +* E: 0.705000 # SYN_REPORT (0)
> -- +705ms
> +* E: 1.496995 0004 0004 589833 # EV_MSC / MSC_SCAN
> 589833
> +* E: 1.496995 0001 0118 0001 # EV_KEY / (null) 1
> +* E: 1.496995 0004 0004 589835 # EV_MSC / MSC_SCAN
> 589835
> +* E: 1.496995 0001 011a # EV_KEY / (null) 0
> +* E: 1.496995 # SYN_REPORT (0)
> -- +791ms
> +*
> +* https://bugs.freedesktop.org/show_bug.cgi?id=92127
> +*
> +* Disable the event codes to avoid stuck buttons.
> +*/
> + if(device->model_flags & EVDEV_MODEL_CYBORG_RAT) {
> + libevdev_disable_event_code(device->evdev, EV_KEY, 0x118);
> + libevdev_disable_event_code(device->evdev, EV_KEY, 0x119);
> + libevdev_disable_event_code(device->evdev, EV_KEY, 0x11a);
> + }
> +}
> +
> struct evdev_device *
> evdev_device_create(struct libinput_seat *seat,
> struct udev_device *udev_device)
> @@ -2318,6 +2352,8 @@ evdev_device_create(struct libinput_seat *seat,
> matrix_init_identity(&device->abs.usermatrix);
> matrix_init_identity(&device->abs.default_calibration);
>
> + evdev_pre_configure_model_quirks(device);
> +
> if (evdev_configure_device(device) == -1)
> goto err;
>
> diff --git a/src/evdev.h b/src/evdev.h
> index 02b5112..8b567a8 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -110,6 +110,7 @@ enum evdev_device_model {
> EVDEV_MODEL_ELANTECH_TOUCHPAD = (1 << 11),
> EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12),
> EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13),
> + EVDEV_MODEL_CYBORG_RAT = (1 << 14),
> };
>
> struct mt_slot {
> diff --git a/test/Makefile.am b/test/Makefile.am
> index 885d9c6..27a2a36 100644