-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Wayland, add missing virtual key codes mappings #1534
Conversation
I'm ok with these changes, however I notice there is some inconsistency in the handling of keys of the first row in winit. Historically these keys were always matched to the numbers, irrespective of the actual keymap. In a game-oriented fashion. Now, for some platforms winit no longer does this and just follow the keymap, for others it still does. Like macos for example: winit/src/platform_impl/macos/event.rs Lines 67 to 76 in 9e3844d
This PR also removes this behavior for Wayland, which currently still has it. Is there something decided about that ? @Osspial @goddessfreya |
I wouldn't count macOS here, since its events are completely broken most of the time and for example alacritty has all the bugs due to that, note, you've linked a bit wrong code here, since the thing Wayland was doing is the same as Scancode to VirtualKeyCode mapping, which is here winit/src/platform_impl/macos/event.rs Lines 112 to 124 in 1f24a09
But it also doesn't get executed in some cases, and the code you've linked is the exact this case, when it decides to do something differently, it maps character it got from macOS to a VirtualKeyCode, so there's no guarantee that "1" was physically Anyway, I'd like to wait here for maintainers as well. |
I applied this diff to diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml
index 10d580b..5593f28 100644
--- a/glutin/Cargo.toml
+++ b/glutin/Cargo.toml
@@ -18,7 +18,7 @@ serde = ["winit/serde"]
[dependencies]
lazy_static = "1.3"
-winit = "0.22.0"
+winit = { git = "https://github.com/kchibisov/winit", branch = "wayland-keysyms" }
[target.'cfg(target_os = "android")'.dependencies]
android_glue = "0.2"
diff --git a/glutin_examples/Cargo.toml b/glutin_examples/Cargo.toml
index 49faae0..3d35945 100644
--- a/glutin_examples/Cargo.toml
+++ b/glutin_examples/Cargo.toml
@@ -12,7 +12,7 @@ publish = false
[dependencies]
glutin = { path = "../glutin" }
-winit = "0.20.0"
+winit = { git = "https://github.com/kchibisov/winit", branch = "wayland-keysyms" }
takeable-option = "0.4"
image = "0.21" And proceeded to try the
|
We've already figured out with @lovesegfault on IRC, that his issue was due to NixOS and rpath. |
This fixes Ctrl+] on |
Is this PR waiting on anything? This would be useful to me, as for my game, I use the period |
Also wondering if this is waiting on something. I rebased this change on master with no conflicts, built Alacritty with it and it does indeed solve alacritty/alacritty#3998. |
Since there was no concerns being made this PR will be a part of #1653. |
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to userscc @vberger