-
Notifications
You must be signed in to change notification settings - Fork 1
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
The problem with self-input non-alphabetic keys in non-latin keyboard layouts #54
Comments
Hi @sanarise, thanks for taking the time to look at the extension and providing feedback! I don't have any experience with international keyboard layouts, or writing software to support it. I have it on the roadmap for the project to learn more about this and make the necessary fixes to support other layouts, but I have been focusing my limited time for the project on improving code coverage, addressing any bug fixes that get identified along the way, and improving legibility of the code base. Knowing that there are folks with international layouts interested in using the extension would substantially raise the priority of that effort. Are your problems limited to a small number number of keys, or are there many problems? It is already possible to modify the default keybindings as you see fit, so if it is just a small number of keys at issue, this should not be to hard to fix. Note that VSCode keybindings can be specified using layout independent bindings, so it may be possible to simply surround the appropriate keys in a bindings with Note that the visual documentation will also ultimately need to be updated to support other keyboard layouts. Right now it assumes a fixed layout. |
Yes, it seems that this is what we need! The symbols on which this problem is reproduced are exactly the symbols listed in the documentation at the link.
I'm not sure. Other layouts are needed only for the national text input in the insert mode. They do not appear in any way in the declaration of modal modes. The usual and annoying problem is that if a user inputs text in their national language, and then goes back into normal modal mode and tries to execute some command, then nothing works for them until they switch back to the English layout. This problem exists, for example, in vim and it is solved with various crutches rather crookedly. In vscode, given the link you gave me, developers thought about it, and in fact, when using these mnemonics, the problem is solved. |
The only thing that remains a mystery to me is why the letter keys a-z work by default? I.e. there is no problem with them and there is no need to write "[KeyA]" instead of "a". Is it possible that one is being mapped to another somewhere? |
Can you clarify what you mean by "work by default"? I don't really understand what differences there are across various keyboard layouts. I think I used a german layout once when I was traveling in Europe, and vaguely remember that one or two alphabetic keys were swapped around (e and z maybe???). Are you saying that in normal mode the swapped keys are located in the US layout instead? Possibly relevant point: some keys are ignored during normal model, and that is done by regex. (but must match the entire word) vscode-master-key/presets/larkin.toml Lines 3439 to 3446 in 8e0b701
|
That's helpful to understand, thank you. That sounds like a good approach for this extension as well, if that is something that works well for other layouts. |
So if I understand your point, the way to fix this problem in |
https://disk.yandex.com/i/q9J0g02R0pe5Hw I recorded a screencast where I use Russian and English layouts and several right-hand keys to demonstrate the behavior (arrows "jklh", square brackets, undo key "u" and semicolon ";").
To correct the 2nd and 3rd points, its need to use the appropriate mnemonics "[...]" in the command rules and in the ignore rule. |
In fact, now in order for me to completely close this problem, I need to use the ignore rule with a complete list of "[...]"-keys. |
A part of my ignore rule now:
|
And there is another minor problem. Bindings that use "[...] "mnemonics are not displayed in the Masterkey Bindings Panel ) |
Awesome, thanks for investigating this further @sanarise. Let me try to delineate the steps to resolve the issues you're seeing as I see them now. Feel free to amend or suggest further improvements.
Question about 3: what do you think the best approach is for the letters shown in this visual documentation when using another layout? The US keyboard? Or the current layout? I believe there is a way to get access to the current keyboard layout via WebAPI, I just haven't investigated this sufficiently to figure out what it would involve (and whether there would be any roadblocks). |
Yes, I think it's the right thing to do.
Yes, we need to check this, but as I see it, it doesn't work for national layouts. So I used:
Yes, the same panel where the keyboard with multi-colored keys is displayed )
No, I think that only the US keyboard should be shown in this panel. |
Wow! What a pain. That sounds unpleasant. Thanks so much for teaching me more about this. I'm going to put fixing the remaining issues at the top of my list of TODOs for this project. Note to self: I think it is worth adding an explicit callout in the README that I'm happy to fix well scoped problems for actual users before wrapping up the 0.3 milestones. |
@sanarise: could you send me the modified version of Larkin you have already setup using the layout independent bindings? Seems like a good place to start in cleaning up the remaining issues. |
The thing is, I don't use Larkin preset as such. I'm building my own super-duper ) preset almost from scratch. It is still far from complete and in many ways similar to vim, but with some special features. In my screencast, I used Larkin only so as not to confuse you with the specifics of my preset. |
By the way, I have another small feature request that is not directly related to the topic under discussion. If you find it necessary, then you will probably have a separate task. ) I would like to be able to change the cursor for a specific prefix (command = "master-key.prefix") |
Hi!
There is such a problem when using national keyboard layouts.
If there is a letter key is in the Latin keyboard layout, then everything is fine – then it works in another (national) layout too. But if this key is not alphabetic (for example, ";" "[" ), and in the national layout it produces a national symbol, then we get a self-input of this national symbol even in normal modal mode. Reproduces in Russian, Finnish, Greek etc. layouts with ";" key, for example.
Is it possible to fix it? Thanks!
The text was updated successfully, but these errors were encountered: