mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-13 04:27:56 -05:00
keyboard, pointer, touch: add time_nsec field to relevant events
The time_nsec field stores the complete event time in nanoseconds. Note that the type is just 64 bits wide, which is too short to store the complete range of values required by the protocol. However, it is enough for libinput, which is our primary event provider.
This commit is contained in:
parent
c22bc0b386
commit
79ed410be4
3 changed files with 9 additions and 0 deletions
|
|
@ -96,6 +96,7 @@ enum wlr_key_state {
|
|||
|
||||
struct wlr_event_keyboard_key {
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
uint32_t keycode;
|
||||
bool update_state; // if backend doesn't update modifiers on its own
|
||||
enum wlr_key_state state;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct wlr_pointer {
|
|||
struct wlr_event_pointer_motion {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
double delta_x, delta_y;
|
||||
double unaccel_dx, unaccel_dy;
|
||||
};
|
||||
|
|
@ -45,6 +46,7 @@ struct wlr_event_pointer_motion {
|
|||
struct wlr_event_pointer_motion_absolute {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
// From 0..1
|
||||
double x, y;
|
||||
};
|
||||
|
|
@ -52,6 +54,7 @@ struct wlr_event_pointer_motion_absolute {
|
|||
struct wlr_event_pointer_button {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
uint32_t button;
|
||||
enum wlr_button_state state;
|
||||
};
|
||||
|
|
@ -71,6 +74,7 @@ enum wlr_axis_orientation {
|
|||
struct wlr_event_pointer_axis {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
enum wlr_axis_source source;
|
||||
enum wlr_axis_orientation orientation;
|
||||
double delta;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ struct wlr_touch {
|
|||
struct wlr_event_touch_down {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
int32_t touch_id;
|
||||
// From 0..1
|
||||
double x, y;
|
||||
|
|
@ -38,12 +39,14 @@ struct wlr_event_touch_down {
|
|||
struct wlr_event_touch_up {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
int32_t touch_id;
|
||||
};
|
||||
|
||||
struct wlr_event_touch_motion {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
int32_t touch_id;
|
||||
// From 0..1
|
||||
double x, y;
|
||||
|
|
@ -52,6 +55,7 @@ struct wlr_event_touch_motion {
|
|||
struct wlr_event_touch_cancel {
|
||||
struct wlr_input_device *device;
|
||||
uint32_t time_msec;
|
||||
uint64_t time_nsec;
|
||||
int32_t touch_id;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue