[uwac] add key repeat state to UwacKeyEvent

This commit is contained in:
Armin Novak 2022-12-12 10:25:48 +01:00 committed by David Fort
parent d90aa5d6f5
commit de0c42273e
2 changed files with 3 additions and 0 deletions

View File

@ -261,6 +261,7 @@ struct uwac_key_event
uint32_t raw_key; uint32_t raw_key;
uint32_t sym; uint32_t sym;
bool pressed; bool pressed;
bool repeated;
}; };
typedef struct uwac_key_event UwacKeyEvent; typedef struct uwac_key_event UwacKeyEvent;

View File

@ -168,6 +168,7 @@ static void keyboard_repeat_func(UwacTask* task, uint32_t events)
key->sym = input->repeat_sym; key->sym = input->repeat_sym;
key->raw_key = input->repeat_key; key->raw_key = input->repeat_key;
key->pressed = true; key->pressed = true;
key->repeated = true;
} }
} }
@ -418,6 +419,7 @@ static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32
keyEvent->sym = sym; keyEvent->sym = sym;
keyEvent->raw_key = key; keyEvent->raw_key = key;
keyEvent->pressed = (state == WL_KEYBOARD_KEY_STATE_PRESSED); keyEvent->pressed = (state == WL_KEYBOARD_KEY_STATE_PRESSED);
keyEvent->repeated = false;
} }
static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, uint32_t serial, static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, uint32_t serial,