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
fix: Fix some mappings involving shift #2018
Conversation
What about |
When neovim/neovim#25068, is fixed, it will also be the same as The reason for not staying backwards compatible with 0.10.4 is simply because reporting the only two reasonable ways of reporting it is |
Also: on a windows machine, with a keyboard with the windows-logo key, wouldn't (i guess the window manager might intercept it, but hopefully microsoft didn't define any mappings that aren't documented in their list of shortcuts) |
For the windows key, there are very few keys that are available and I'm not sure if the ones that are forwarded from Winit, during my quick testing it seems like they are not. But if it's available and winit forwards it, then it should be mappable. Usually, you need to register an actual hotkey to capture the windows key events, and some are not even overridable by using global hotkeys. |
fwiw, LGTM (though i'm not sure if this matters since i'm not a regular contributor) |
Pulled this branch and tested locally. Can confirm that this PR fixes this issue |
@technicalpickles, Can you test with some special characters as well, like |
Works perfect from what I tested on Wayland with Bone as layout. What was important for me that most characters were indeed mapped as the resulting characters. For example, + on QWERTY results in |
@fredizzimo Just tested, and that one does not seem to be working. Using these mappings: vim.api.nvim_set_keymap("n", "<D-5>", "<cmd>echo 'D-5'<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<D-%>", "<cmd>echo 'D-%'<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<D-i>", "<cmd>echo 'D-i'<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<D-I>", "<cmd>echo 'D-I'<CR>", { noremap = true }) These all work except for |
@technicalpickles, thanks, we will not close #1237 just yet then. |
NOTE: this needs careful testing before merging, so that something else does not break,
What kind of change does this PR introduce?
This fixes #2017 - "can't map
<c-s-v>
". This is done by sending shfit when it's combined with CTRL and an ascii alpha character. See the corresponding logic here https://github.com/neovim/neovim/blob/c422722b2e94b94d7f9374dbae12f17580cd1d41/src/nvim/keycodes.c#L764-L799It also partially fixes the following issue #1237 - "CMD + SHIFT works as CMD only". Partially because it's likely not dealing with all the cases. The real issue is in Winit. The fix is to normalize shifted asicii alpha characters already on the Neovide side. This is always done one the Neovim side anyway, so it should be a safe thing to do.
Note that only the following form of mapping work:
<D-A>
. There appears to be a bug in Neovim neovim/neovim#25068, preventing the alternative forms<D-S-A>
and<D-S-a>
from working, but once that's fixed all forms should work. The<D-A>
form was chosen because that's the most basic form, for example<M-S-a>
also simplifies down to<M-A>
in Neovide, so it's consistent with that. Furthermore, this format of mapping will work, even after the Winit bug rust-windowing/winit#3078 is fixed.The same non
<S->
form should also always be use for non-alpha mappings for all modifiers. The only special case is CTRL + SHIFT + alpha, which should be mapped like<C-S-A>
due to legacy reasons.From https://neovim.io/doc/user/intro.html (the notation section)
Did this PR introduce a breaking change?
No