mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-06 12:51:28 +03:00
Fix Keycodes in X11
Keycodes are now correctly offset for X11
This commit is contained in:
@@ -32,7 +32,7 @@ input capture (to send events *to* other clients) on different operating systems
|
||||
| Wayland (wlroots) | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| Wayland (KDE) | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| Wayland (Gnome) | :heavy_check_mark: | WIP |
|
||||
| X11 | ( :heavy_check_mark: ) | WIP |
|
||||
| X11 | :heavy_check_mark: | WIP |
|
||||
| Windows | ( :heavy_check_mark: ) | WIP |
|
||||
| MacOS | ( :heavy_check_mark: ) | WIP |
|
||||
|
||||
|
||||
@@ -62,8 +62,7 @@ impl X11Consumer {
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn emulate_key(&self, key: u32, state: u8) {
|
||||
let _ = key;
|
||||
let _ = state;
|
||||
let key = key + 8; // xorg keycodes are shifted by 8
|
||||
unsafe {
|
||||
xtest::XTestFakeKeyEvent(self.display, key, state as i32, 0);
|
||||
}
|
||||
@@ -99,9 +98,7 @@ impl EventConsumer for X11Consumer {
|
||||
PointerEvent::Frame {} => {}
|
||||
},
|
||||
Event::Keyboard(KeyboardEvent::Key { time: _, key, state }) => {
|
||||
let _ = key;
|
||||
let _ = state;
|
||||
// self.emulate_key(key, state);
|
||||
self.emulate_key(key, state);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user