This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
forked from rust-windowing/glutin
-
Notifications
You must be signed in to change notification settings - Fork 33
Wrong keycodes reported for non-standard layouts. Fixed upstream #139
Comments
See also servo/servo#19120 |
And the previous attempt servo/servo#17311 |
Is this fixed? |
This isn't fixed in branch I had to apply this fix from the commit I linked in my original report: diff --git a/src/api/x11/input.rs b/src/api/x11/input.rs
index 9e600c4..d24fe11 100644
--- a/src/api/x11/input.rs
+++ b/src/api/x11/input.rs
@@ -158,3 +158,5 @@ impl XInputEventHandler {
let mut keysym = unsafe {
- (self.display.xlib.XKeycodeToKeysym)(self.display.display, event.keycode as ffi::KeyCode, 0)
+ let mut keysym = 0;
+ (self.display.xlib.XLookupString)(event, ptr::null_mut(), 0, &mut keysym, ptr::null_mut());
+ keysym
}; I tested it by applying the following patch, running diff --git a/examples/window.rs b/examples/window.rs
index ddf98a9..c811652 100644
--- a/examples/window.rs
+++ b/examples/window.rs
@@ -33,2 +33,3 @@ fn main() {
glutin::Event::Closed => break,
+ glutin::Event::KeyboardInput(_, _, Some(glutin::VirtualKeyCode::H)) => println!("Pressed H"),
_ => () |
Servo uses upstream glutin now. |
Upstream glutin is fine. You may close this bug if this codebase is deprecated. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
servo-glutin reports no, or wrong, keycodes for most of my letter keys.
I encountered this bug while using Webrender's Wrench. It supports keyboard shortcuts to activate features, and none of them worked.
This has been fixed in winit, which is used by upstream glutin: rust-windowing/winit#273
There's a lot of changes between the codebases, but I managed to fix this by changing
to
This is what
setxkbmap
reports for my keyboard:I don't know how many more bugs lurk in servo-glutin that were fixed upstream (e.g. The function
keycode_to_element
should be namedkeysym_to_element
). Are there any plans to merge upstream fixes?The text was updated successfully, but these errors were encountered: