handle keyboard modifiers
@@ -10,7 +10,10 @@ fn key_is_meta(key: u32) -> bool {
}
impl KeyboardHandler for Keyboard {
- fn on_key(&mut self, compositor: CompositorHandle, keyboard: KeyboardHandle, event: &KeyEvent) {
+ fn on_key(&mut self,
+ compositor: CompositorHandle,
+ _keyboard: KeyboardHandle,
+ event: &KeyEvent) {
with_handles!([(compositor: {compositor})] => {
if event.key_state() == WLR_KEY_PRESSED {
for key in event.pressed_keys() {
@@ -38,13 +41,21 @@ impl KeyboardHandler for Keyboard {
}
}
let server: &mut Server = compositor.into();
- with_handles!([(seat: {&mut server.seat.seat}),
- (keyboard: {keyboard})] => {
+ with_handles!([(seat: {&mut server.seat.seat})] => {
seat.keyboard_notify_key(event.time_msec(),
event.keycode(),
event.key_state() as u32);
- seat.keyboard_send_modifiers(&mut keyboard.get_modifier_masks());
}).expect("Seat was destroyed");
}).unwrap();
}
+
+ fn modifiers(&mut self, compositor: CompositorHandle, keyboard: KeyboardHandle) {
+ with_handles!([(compositor: {compositor})] => {
+ let server: &mut Server = compositor.into();
+ with_handles!([(seat: {&mut server.seat.seat}),
+ (keyboard: {keyboard})] => {
+ seat.keyboard_notify_modifiers(&mut keyboard.get_modifier_masks());
+ }).unwrap();
+ }).unwrap();
+ }
}
