Skip to content

Commit 83b0372

Browse files
committed
Fix tab key
For some reason, Steam sends keycode 156 when clicking Tab on the on screen keyboard.
1 parent 4596690 commit 83b0372

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ pub extern "C" fn XTestFakeKeyEvent(
6666
let mut dev = DEVICE.lock().unwrap();
6767

6868
// Seems that X11 keycodes are just 8 + linux keycode - https://wiki.archlinux.org/title/Keyboard_input#Identifying_keycodes
69-
let key = Key::new((keycode - 8) as u16);
69+
let key = match keycode {
70+
156 => Key::KEY_TAB, // I have no idea where this comes from
71+
keycode => Key::new((keycode - 8) as u16)
72+
};
7073
dev.emit(&[InputEvent::new_now(EventType::KEY, key.0, is_press as i32)])
7174
.unwrap();
7275
1

0 commit comments

Comments
 (0)