-
Notifications
You must be signed in to change notification settings - Fork 29
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
Custom Keybinds #34
Comments
Looks like the scancode doesn't make sense for this application :/ I'll have to dig into why the virtual keycodes aren't always resolved / are resolved to different keys |
May just be an issue we get to live with for a bit. I'll just start working on customizable keybindings and then hopefully a future update to |
@LovecraftianHorror Yeah I ran into the issue that The problem is that with every platform winit supports, there's a thousand things that become too complicated to support properly. I created smithay-clipboard in 2019 to get around winit not handling clipboarding by pumping its own wayland events on a background thread (major hack) and its still used today by Alacritty. Moral of that story is hacking your way around winit is practically the officially supported way to do things. I'll have a look if alacritty's solved this or its just another hack. |
It seems Alacritty uses macros to parse key bindings into winit I would suggest just choosing some sensible defaults for key bindings and then let users configure the key bindings that work for their system. |
I wish it made that much sense :/ It seems like it doesn't resolve to a virtual keycode at all for some reason. 4 gets picked up, but 4+Shift is
I guess as a last resort we can let user's specify the scancodes. It's not a portable solution, but I think it's fine as long as we clearly state that it's a last resort
That's the plan 👍 |
I'm planning on adding support for specifying custom keybinds this weekend. This is the general gist of how I want to expose it
One thing that I noticed that may complicate things is that a surprising number of keys don't get picked up with a
VirtualKeyCode
on my keyboard like $%^&() etc.Another thing is that there may be system differences here too. I noticed that @trimental uses
VirtualKeyCode::Equals
+Shift to detect a "+", but for me it registers as aVirtualKeyCode::Plus
. It's actually impossible for me to useVirtualKeyCode::Equals
with shift on my keyboard layout. Switching to using the scancode could fix this and the missing keys issueThe text was updated successfully, but these errors were encountered: