1
0
Fork 0
forked from wry/wry

wl_keyboard: don't send key-up events for keys that are not logically down

This commit is contained in:
Julian Orth 2025-01-23 13:48:23 +01:00
parent abaeed4c01
commit 53c38bdd68
9 changed files with 68 additions and 27 deletions

View file

@ -52,11 +52,14 @@ impl EiKeyboard {
});
}
pub fn send_key(&self, key: u32, state: u32) {
pub fn send_key(&self, key: u32, state: KeyState) {
self.client.event(ServerKey {
self_id: self.id,
key,
state,
state: match state {
KeyState::Released => 0,
KeyState::Pressed => 1,
},
});
}
}