mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-11 05:34:26 -04:00
backend, virtual_keyboard: set the time_nsec field of relevant events
Backends modified: libinput (with microsecond precision), X11 (with millisecond precision), RDP (with millisecond precision), and Wayland (with nanosecond precision if the host server supports the input-timestamps protocol, otherwise millisecond precision); and virtual-keyboard protocol (with millisecond precision).
This commit is contained in:
parent
79ed410be4
commit
e617da0378
9 changed files with 172 additions and 38 deletions
|
|
@ -65,8 +65,9 @@ void handle_keyboard_key(struct libinput_event *event,
|
|||
struct libinput_event_keyboard *kbevent =
|
||||
libinput_event_get_keyboard_event(event);
|
||||
struct wlr_event_keyboard_key wlr_event = { 0 };
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_keyboard_get_time_usec(kbevent));
|
||||
uint64_t event_time = libinput_event_keyboard_get_time_usec(kbevent);
|
||||
wlr_event.time_msec = usec_to_msec(event_time);
|
||||
wlr_event.time_nsec = event_time * 1000;
|
||||
wlr_event.keycode = libinput_event_keyboard_get_key(kbevent);
|
||||
enum libinput_key_state state =
|
||||
libinput_event_keyboard_get_key_state(kbevent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue