-
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
Keyboard layouts are ignored (all platforms) #36
Comments
This might be an upstream Avalonia bug. Does this match the problem you're encountering? |
Yes, sounds exactly like my problem.
I already had the feeling it was standard US layout for some but not all the keys.
Am 23.07.2019 um 08:57 schrieb Yatao Li <[email protected]>:
This might be an upstream Avalonia bug.
I also notice some problems for Mac keyboards -- for a Japanese layout keyboard with different arrangement of symbols -- but fvim treats the keystrokes as if it's on a standard US keyboard (yeah, got shift+"something" for ':', but on the actual keyboard it's somewhere else)
Does this match the problem you're encountering?
I can file another issue to the upstream (or like the last time, send a PR over).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Alright. Let me make another attempt at the Avalonia key mapping problem. |
The issue is reproduced on my end. OS: Windows 10 1903 Open up From the above result, I figure it'd a QWERTZ layout. Open up Which is a bit puzzling -- it's neither QWERTY, nor the German QWERTZ. |
Hi @yatli I'm experiencing the same issue. Please take the following with a grain of salt since I'm neither an F# expert nor an Avalonia expert. I'm using a German keyboard layout where ":" is on "SHIFT-." (so, SHIFT-period). The triggered input is ">".
So keystroke detection seems to work, right? The pressed key combination is then transformed here: https://github.com/yatli/fvim/blob/master/model.fs#L410 which seems to trigger the match here: https://github.com/yatli/fvim/blob/master/model.fs#L205 "SHIFT-period" is then explicitly transformed to nvim_input ">" here: https://github.com/yatli/fvim/blob/master/model.fs#L299 Of course, changing
to
"solves" the issue (for users of a German keyboard layout, therefore the air quotes 😃). Edit: the full trace seems to be even more interesting:
The |
+1 Is this something that must be implemented by hand or the layout translation should be handled by the OS itself? |
+1 |
Same problem for me as well, Windows 10 using a Swedish keyboard. The resulting key presses appear to be neither Swedish nor US. If I switch to US layout in Windows it works as expected, but I would rather use the Swedish layout... |
Same problem for me Windows 10 using a Italian keyboard layout, but fvim use English layout. |
I've done another round of research on this. Windows: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapvirtualkeyexa As the number of users with this problem increases I'd start to feel guilty for pushing this one back for other stuff.. A question for you guys, how do you expect the vim key mapping to behavior? For example if I want to go INSERT, should I press "i", or whatever key located at where the en-US "i" is? |
Edit: after second thought... It doesn't make sense, because this is platform-specific, and Avalonia already hides the info we need and instead present us with Avalonia key sequences. |
@yatli My two cents, in short: keys should be mapped according to the system settings, not according to en-US. Longer version: ( |
understood. |
@krissen any comments on symbol processing? Like, is there any symbol that doesn't exist on the en-US keyboard? |
@yatli There are. Just speaking from my own workflow/vim-config, those symbols would not be important with regards to commands and such (seldom used in binds), but naturally are essential for writing text. That is, I could not use an editor which would not be able to input symbols such as The key thing (pun intended) really is, for a key-press to be predictable. That is, for key-presses in one app to be the same in every other: that which is set by the system. |
Ah, I mean punctuations. :) |
Oh, I see. Nonesuch that I am aware of. |
There's a problem wrt punct rewriting.
This is the only entry to translate the key codes into mapped keys -- but it translates into unshifted keys. |
Ok PR is up: AvaloniaUI/Avalonia#4447 |
@gibboni do you build yourself? If so, please try to run in debug mode and post some logs. |
Wow. |
In FRA |
Yes, I do build fvim myself. I got the following error when I pressed AltGr: |
Interesting. If I press the keys that got swallowed I got nothing. No errors. |
It seems that the AltGr is working even though log states "Key (None, None, ""). If I press AltGr-+ I get in the logs: The problem now seems to be, that some of the keys are completely dead and don't show anything in the log output. |
@gibboni the internal logic is like this: As mentioned earlier in the thread, for mapped keys, both KeyDown and TextInput events will be triggered. |
Tried going there to fetch it; I get to the page, click on So thought I'd give building from source a go. Checked out Am new to dotnet, so perhaps I'm running the wrong commands or something? Or attempting to build the wrong branch? Let me know what I'm doing wrong -- or if the above means you've got testing results. ;-) Am on macOS, sv-SE. |
Got it. As with the version built from source, I get an unresponsive application window. That is it. If I build it from source, it reads my vim dotfiles, and seems to have the appearance I'd expect etc. The "artifacts version" does not. (If I remove |
Thanks for testing. |
@krissen did you try to run in debug mode? |
I think the relevant parts would be the following:
That is, all input is rejected. EDIT: Except Shift. EDIT2: Just for the fun of it, I changed system keyboard layout to en-GB. Output is, I guess unsurprisingly, identical. |
I could add, that it interprets keypresses according to an English keyboard layout. That is, if I press
|
Yeah, these are raw scancodes. |
Ah well. At least we played. |
Next step attack vectors:
|
@krissen all hope is not lost! The code is on merged to master, and the artifacts will be ready shortly. |
Guys, v0.3.512 has been released with keyboard layout fix merged in. |
Hi! Was this fix meant only for macOS? Because on Windows nothing that requires AltGr still doesn't work. |
This fix should cover all platforms. |
(MacOS doesn't differentiate between Alt (or 'Opt' in Mac-speak) and AltGR, rather there is only (left-)Alt and (right-)Alt.) |
0.3.513 is published. Case closed. 😎 |
@yatli I'm using the Dvorak layout and experiencing issues with the latest build on macOS 12.3, if I press in insert mode (raw key codes being Ctrl + J on QWERTY), FVim interprets it as and inserts a newline instead of deleting one character back, same for all other shortcuts with Ctrl (e.g. inserts a tab instead of exiting to normal mode). I tried with and without Shift shortcuts appears to be fine though. |
fvim 0.2 and also previous version do not handle my standard German keyboard layout correctly.
For example a ":" is not on "SHIFT-." but on "SHIFT-ü"
AFAIR this also happened to me in previous builds of fvim.
Windows 1809 build 17763.615 settings:
Let me know what else you need.
Thanks in advance!
The text was updated successfully, but these errors were encountered: