mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-10 13:29:44 -05:00
Update keyboard modifiers in example compositor
This commit is contained in:
parent
2db04c369e
commit
edbaa7d6ac
2 changed files with 13 additions and 3 deletions
|
|
@ -110,6 +110,16 @@ static void handle_keyboard_key(struct keyboard_state *keyboard, uint32_t keycod
|
|||
}
|
||||
|
||||
if (seat_handle && seat_handle->keyboard) {
|
||||
uint32_t depressed = xkb_state_serialize_mods(keyboard->xkb_state,
|
||||
XKB_STATE_MODS_DEPRESSED);
|
||||
uint32_t latched = xkb_state_serialize_mods(keyboard->xkb_state,
|
||||
XKB_STATE_MODS_LATCHED);
|
||||
uint32_t locked = xkb_state_serialize_mods(keyboard->xkb_state,
|
||||
XKB_STATE_MODS_LOCKED);
|
||||
uint32_t group = xkb_state_serialize_layout(keyboard->xkb_state,
|
||||
XKB_STATE_LAYOUT_EFFECTIVE);
|
||||
wl_keyboard_send_modifiers(seat_handle->keyboard, ++sample->serial, depressed,
|
||||
latched, locked, group);
|
||||
wl_keyboard_send_key(seat_handle->keyboard, ++sample->serial, 0, keycode, key_state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue