mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 14:40:26 +01:00
touchpad: only check keyboards for disable-while-typing
The keyboard test is a simple one, if we have the first row of alphabetic keys, we assume it's a full keyboard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
parent
08fbfe52d2
commit
cfdb83b305
3 changed files with 33 additions and 10 deletions
|
|
@ -1006,16 +1006,18 @@ tp_interface_device_added(struct evdev_device *device,
|
|||
tp_trackpoint_event, tp);
|
||||
}
|
||||
|
||||
/* FIXME: detect external keyboard better */
|
||||
kbd_is_internal = bus_tp != BUS_BLUETOOTH &&
|
||||
bus_kbd == bus_tp;
|
||||
if (tp_is_internal && kbd_is_internal &&
|
||||
tp->dwt.keyboard == NULL) {
|
||||
libinput_device_add_event_listener(&added_device->base,
|
||||
&tp->dwt.keyboard_listener,
|
||||
tp_keyboard_event, tp);
|
||||
tp->dwt.keyboard = added_device;
|
||||
tp->dwt.keyboard_active = false;
|
||||
if (added_device->tags & EVDEV_TAG_KEYBOARD) {
|
||||
/* FIXME: detect external keyboard better */
|
||||
kbd_is_internal = bus_tp != BUS_BLUETOOTH &&
|
||||
bus_kbd == bus_tp;
|
||||
if (tp_is_internal && kbd_is_internal &&
|
||||
tp->dwt.keyboard == NULL) {
|
||||
libinput_device_add_event_listener(&added_device->base,
|
||||
&tp->dwt.keyboard_listener,
|
||||
tp_keyboard_event, tp);
|
||||
tp->dwt.keyboard = added_device;
|
||||
tp->dwt.keyboard_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (tp->sendevents.current_mode !=
|
||||
|
|
|
|||
20
src/evdev.c
20
src/evdev.c
|
|
@ -733,6 +733,25 @@ evdev_tag_trackpoint(struct evdev_device *device,
|
|||
device->tags |= EVDEV_TAG_TRACKPOINT;
|
||||
}
|
||||
|
||||
static void
|
||||
evdev_tag_keyboard(struct evdev_device *device,
|
||||
struct udev_device *udev_device)
|
||||
{
|
||||
int code;
|
||||
|
||||
if (!libevdev_has_event_type(device->evdev, EV_KEY))
|
||||
return;
|
||||
|
||||
for (code = KEY_Q; code <= KEY_P; code++) {
|
||||
if (!libevdev_has_event_code(device->evdev,
|
||||
EV_KEY,
|
||||
code))
|
||||
return;
|
||||
}
|
||||
|
||||
device->tags |= EVDEV_TAG_KEYBOARD;
|
||||
}
|
||||
|
||||
static void
|
||||
fallback_process(struct evdev_dispatch *dispatch,
|
||||
struct evdev_device *device,
|
||||
|
|
@ -831,6 +850,7 @@ fallback_tag_device(struct evdev_device *device,
|
|||
{
|
||||
evdev_tag_external_mouse(device, udev_device);
|
||||
evdev_tag_trackpoint(device, udev_device);
|
||||
evdev_tag_keyboard(device, udev_device);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ enum evdev_device_tags {
|
|||
EVDEV_TAG_INTERNAL_TOUCHPAD = (1 << 1),
|
||||
EVDEV_TAG_TRACKPOINT = (1 << 2),
|
||||
EVDEV_TAG_TOUCHPAD_TRACKPOINT = (1 << 3),
|
||||
EVDEV_TAG_KEYBOARD = (1 << 4),
|
||||
};
|
||||
|
||||
enum evdev_middlebutton_state {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue