evdev: add evdev_pointer_notify_physical_button

No functional changes at this point, this merely splits up any physical
buttons (i.e. that represent buttons that exist on that device) vs. other
buttons that are emulated in some way or another.

This is in preparation for the addition of middle button emulation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2015-04-13 14:47:26 +10:00
parent da595b8952
commit 3c500b597c
3 changed files with 22 additions and 8 deletions

View file

@ -734,10 +734,10 @@ tp_post_physical_buttons(struct tp_dispatch *tp, uint64_t time)
state = LIBINPUT_BUTTON_STATE_RELEASED;
b = evdev_to_left_handed(tp->device, button);
evdev_pointer_notify_button(tp->device,
time,
b,
state);
evdev_pointer_notify_physical_button(tp->device,
time,
b,
state);
}
button++;

View file

@ -137,6 +137,15 @@ evdev_keyboard_notify_key(struct evdev_device *device,
keyboard_notify_key(&device->base, time, key, state);
}
void
evdev_pointer_notify_physical_button(struct evdev_device *device,
uint32_t time,
int button,
enum libinput_button_state state)
{
evdev_pointer_notify_button(device, time, button, state);
}
void
evdev_pointer_notify_button(struct evdev_device *device,
uint32_t time,
@ -430,10 +439,10 @@ evdev_button_scroll_button(struct evdev_device *device,
} else {
/* If the button is released quickly enough emit the
* button press/release events. */
evdev_pointer_notify_button(device, time,
evdev_pointer_notify_physical_button(device, time,
device->scroll.button,
LIBINPUT_BUTTON_STATE_PRESSED);
evdev_pointer_notify_button(device, time,
evdev_pointer_notify_physical_button(device, time,
device->scroll.button,
LIBINPUT_BUTTON_STATE_RELEASED);
}
@ -505,7 +514,7 @@ evdev_process_key(struct evdev_device *device,
evdev_button_scroll_button(device, time, e->value);
break;
}
evdev_pointer_notify_button(
evdev_pointer_notify_physical_button(
device,
time,
evdev_to_left_handed(device, e->code),
@ -2208,7 +2217,7 @@ release_pressed_keys(struct evdev_device *device)
LIBINPUT_KEY_STATE_RELEASED);
break;
case EVDEV_KEY_TYPE_BUTTON:
evdev_pointer_notify_button(
evdev_pointer_notify_physical_button(
device,
time,
evdev_to_left_handed(device, code),

View file

@ -306,6 +306,11 @@ evdev_pointer_notify_button(struct evdev_device *device,
uint32_t time,
int button,
enum libinput_button_state state);
void
evdev_pointer_notify_physical_button(struct evdev_device *device,
uint32_t time,
int button,
enum libinput_button_state state);
void
evdev_init_natural_scroll(struct evdev_device *device);