pressed state handling
@@ -130,6 +130,7 @@ impl keyboard::Handler for ExKeyboardHandler {
compositor_handle: compositor::Handle,
keyboard_handle: keyboard::Handle,
key_event: &keyboard::event::Key) {
+ if key_event.key_state() == WLR_KEY_PRESSED {
for key in key_event.pressed_keys() {
match key {
KEY_Escape => {
@@ -137,12 +138,10 @@ impl keyboard::Handler for ExKeyboardHandler {
return;
},
KEY_F1 => {
- if key_event.key_state() == WLR_KEY_PRESSED {
thread::spawn(move || {
Command::new("weston-terminal").output().unwrap();
});
return;
- }
},
KEY_XF86Switch_VT_1 ... KEY_XF86Switch_VT_12 => {
compositor_handle.run(|compositor| {
@@ -155,7 +154,8 @@ impl keyboard::Handler for ExKeyboardHandler {
}
_ => {/*do nothing*/}
}
- };
+ }
+ }
#[dehandle] let compositor = compositor_handle;
let state: &mut State = compositor.downcast();
