mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-21 18:13:20 +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 (wlroots) | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| Wayland (KDE) | :heavy_check_mark: | :heavy_check_mark: |
|
| Wayland (KDE) | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| Wayland (Gnome) | :heavy_check_mark: | WIP |
|
| Wayland (Gnome) | :heavy_check_mark: | WIP |
|
||||||
| X11 | ( :heavy_check_mark: ) | WIP |
|
| X11 | :heavy_check_mark: | WIP |
|
||||||
| Windows | ( :heavy_check_mark: ) | WIP |
|
| Windows | ( :heavy_check_mark: ) | WIP |
|
||||||
| MacOS | ( :heavy_check_mark: ) | WIP |
|
| MacOS | ( :heavy_check_mark: ) | WIP |
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ impl X11Consumer {
|
|||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn emulate_key(&self, key: u32, state: u8) {
|
fn emulate_key(&self, key: u32, state: u8) {
|
||||||
let _ = key;
|
let key = key + 8; // xorg keycodes are shifted by 8
|
||||||
let _ = state;
|
|
||||||
unsafe {
|
unsafe {
|
||||||
xtest::XTestFakeKeyEvent(self.display, key, state as i32, 0);
|
xtest::XTestFakeKeyEvent(self.display, key, state as i32, 0);
|
||||||
}
|
}
|
||||||
@@ -99,9 +98,7 @@ impl EventConsumer for X11Consumer {
|
|||||||
PointerEvent::Frame {} => {}
|
PointerEvent::Frame {} => {}
|
||||||
},
|
},
|
||||||
Event::Keyboard(KeyboardEvent::Key { time: _, key, state }) => {
|
Event::Keyboard(KeyboardEvent::Key { time: _, key, state }) => {
|
||||||
let _ = key;
|
self.emulate_key(key, state);
|
||||||
let _ = state;
|
|
||||||
// self.emulate_key(key, state);
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user