mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 14:42:25 +00:00
wlr_keyboard_group: Use get_current_time_msec
This commit is contained in:
parent
8bb6935374
commit
d6b47c3ab0
@ -10,6 +10,7 @@
|
|||||||
#include "wlr/types/wlr_keyboard.h"
|
#include "wlr/types/wlr_keyboard.h"
|
||||||
#include "wlr/types/wlr_keyboard_group.h"
|
#include "wlr/types/wlr_keyboard_group.h"
|
||||||
#include "wlr/util/log.h"
|
#include "wlr/util/log.h"
|
||||||
|
#include "util/time.h"
|
||||||
|
|
||||||
struct keyboard_group_device {
|
struct keyboard_group_device {
|
||||||
struct wlr_keyboard *keyboard;
|
struct wlr_keyboard *keyboard;
|
||||||
@ -183,10 +184,8 @@ static void refresh_state(struct keyboard_group_device *device,
|
|||||||
wl_array_init(&keys);
|
wl_array_init(&keys);
|
||||||
|
|
||||||
for (size_t i = 0; i < device->keyboard->num_keycodes; i++) {
|
for (size_t i = 0; i < device->keyboard->num_keycodes; i++) {
|
||||||
struct timespec now;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
|
||||||
struct wlr_keyboard_key_event event = {
|
struct wlr_keyboard_key_event event = {
|
||||||
.time_msec = (int64_t)now.tv_sec * 1000 + now.tv_nsec / 1000000,
|
.time_msec = get_current_time_msec(),
|
||||||
.keycode = device->keyboard->keycodes[i],
|
.keycode = device->keyboard->keycodes[i],
|
||||||
.update_state = true,
|
.update_state = true,
|
||||||
.state = state
|
.state = state
|
||||||
|
Loading…
Reference in New Issue
Block a user