mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
Fix keycodes
This commit is contained in:
parent
9ca5b0cae8
commit
38bc0ab1cc
1 changed files with 4 additions and 2 deletions
|
@ -45,7 +45,7 @@ int x11_event(int fd, uint32_t mask, void *data) {
|
|||
struct wlr_event_keyboard_key key = {
|
||||
.time_sec = ts.tv_sec,
|
||||
.time_usec = ts.tv_nsec / 1000,
|
||||
.keycode = press->detail,
|
||||
.keycode = press->detail - 8,
|
||||
.state = WLR_KEY_PRESSED,
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,7 @@ int x11_event(int fd, uint32_t mask, void *data) {
|
|||
struct wlr_event_keyboard_key key = {
|
||||
.time_sec = ts.tv_sec,
|
||||
.time_usec = ts.tv_nsec / 1000,
|
||||
.keycode = press->detail,
|
||||
.keycode = press->detail - 8,
|
||||
.state = WLR_KEY_RELEASED,
|
||||
};
|
||||
|
||||
|
@ -94,6 +94,8 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
|
|||
goto error_x11;
|
||||
}
|
||||
|
||||
XSetEventQueueOwner(x11->xlib_conn, XCBOwnsEventQueue);
|
||||
|
||||
int fd = xcb_get_file_descriptor(x11->xcb_conn);
|
||||
struct wl_event_loop *ev = wl_display_get_event_loop(display);
|
||||
x11->event_source = wl_event_loop_add_fd(ev, fd, WL_EVENT_READABLE, x11_event, x11);
|
||||
|
|
Loading…
Reference in a new issue