mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-11 12:01:27 +03:00
use all modifiers to switch back instead of ESC
This commit is contained in:
@@ -360,9 +360,12 @@ impl Dispatch<wl_keyboard::WlKeyboard, ()> for App {
|
|||||||
_: &QueueHandle<Self>,
|
_: &QueueHandle<Self>,
|
||||||
) {
|
) {
|
||||||
match event {
|
match event {
|
||||||
wl_keyboard::Event::Key { serial: _, time: _, key, state: _ } => {
|
wl_keyboard::Event::Key {..} => {
|
||||||
if key == 1 {
|
app.connection.send_event(event);
|
||||||
// ESC key
|
}
|
||||||
|
wl_keyboard::Event::Modifiers { mods_depressed, ..} => {
|
||||||
|
app.connection.send_event(event);
|
||||||
|
if mods_depressed == 77 { // ctrl shift super alt
|
||||||
if let Some(pointer_lock) = app.pointer_lock.as_ref() {
|
if let Some(pointer_lock) = app.pointer_lock.as_ref() {
|
||||||
pointer_lock.destroy();
|
pointer_lock.destroy();
|
||||||
app.pointer_lock = None;
|
app.pointer_lock = None;
|
||||||
@@ -375,13 +378,8 @@ impl Dispatch<wl_keyboard::WlKeyboard, ()> for App {
|
|||||||
shortcut_inhibitor.destroy();
|
shortcut_inhibitor.destroy();
|
||||||
app.shortcut_inhibitor = None;
|
app.shortcut_inhibitor = None;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
app.connection.send_event(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wl_keyboard::Event::Modifiers {..} => {
|
|
||||||
app.connection.send_event(event);
|
|
||||||
}
|
|
||||||
wl_keyboard::Event::Keymap { format:_ , fd, size:_ } => {
|
wl_keyboard::Event::Keymap { format:_ , fd, size:_ } => {
|
||||||
let mmap = unsafe { Mmap::map(&File::from_raw_fd(fd.as_raw_fd())).unwrap() };
|
let mmap = unsafe { Mmap::map(&File::from_raw_fd(fd.as_raw_fd())).unwrap() };
|
||||||
app.connection.offer_data(protocol::DataRequest::KeyMap, mmap);
|
app.connection.offer_data(protocol::DataRequest::KeyMap, mmap);
|
||||||
|
|||||||
Reference in New Issue
Block a user