Comments (29)
That's really interesting, because I use Dvorak and that never happens to me.
from amvim-for-vscode.
@erikbra
I can't reproduce this bug on OSX.
What OS do you use?
from amvim-for-vscode.
It would be helpful if you could upload a screen capture.
Here is an app to do this: http://www.cockos.com/licecap/
from amvim-for-vscode.
I'm on Windows. I think I found the problem more accurately.
In navigation mode, there is always English keyboard layout, so no navigation using non-alphanumeric characters work as expected in my keyboard layout (^, $, etc).
Whenever I enter edit mode, every character I type is according to English keyboard layout, until I press an alphanumeric character (in English keyboard layout). Then it switches to the correct keyboard layout. I have attached a screen capture and a picture of my keyboard.
I type i to enter edit mode, then I press the following keys on my keyboard:
øæå'¨\aøæå'¨\ (number 1-6 on attached image, then the a key, then number 1-6 on attached again)
That is, I press some keys that are all non-alphanumeric in English keyboard layout, then I press the a key, and then press the exact same keys again, now the correct characters are entered.
So, to sum up, in navigation mode, and in edit mode before pressing any alphanumeric characters, English keyboard layout is always used. That is the bug.
from amvim-for-vscode.
Thanks for the description, very helpful.
The first `']/;[ is not English layout either.
Do you get the same bug without this extension installed?
I'm thinking if this is a bug of VSCode.
from amvim-for-vscode.
The first letters are English layout, yes. Compare with, e.g. Google Image of English keyboard layout
It is not a VSCode bug. Norwegian layout works as expected when I uninstall the extension.
There is no "normal/navigation mode" in vscode without amVim either, so it's really not possible ;)
from amvim-for-vscode.
Can you try the same thing using https://github.com/VSCodeVim/Vim ?
I want to confirm if it is the problem with VSCode's extension package.json
.
from amvim-for-vscode.
VsCodeVim obviously has a concious choice about this, because it lets me configure (some) keyboard layouts:
Configure
Adjust configurations through user settings (File -> Preferences -> User Settings).
vim.keyboardLayout:
Supported Values: en-US (QWERTY) (default), es-ES (QWERTY), de-DE (QWERTZ), da-DK > (QWERTY)*
I seriously don't understand why a vi input mode plugin should have its own keyboard layout settings, and not use the default in Windows.
VSCodeVim uses English keyboard layout in "normal/navigation" mode (which is annoying enough). However, VSCodeVim switches to my Norwegian keyboard layout at once if I enter edit mode, which is better.
Why does Code in a way or another have its own keyboard layout? is this a bug or a feature? Or have you conciously chosen another keyboard layout in your plugin?
from amvim-for-vscode.
Extensions can't get layout informations from VSCode. Infact, VSCode should handle these for the extension, but it doesn't for now.
Please give me some time to solve this problem.
from amvim-for-vscode.
Thanks. Just tell me if you need any more help troubleshooting or testing the issue.
from amvim-for-vscode.
Any progress on this, @aioutecism? Anything I can do to contribute?
from amvim-for-vscode.
@erikbra
I'm trying to add a layer to mapping system to deal with all kinds of keyboard layout.
I would be great if you can help test when I finish it.
Please give me some more time.
from amvim-for-vscode.
I'd be keen to try the proposed fix as well. I'm on OSX and appear to have a related issue. I use a British keyboard mapping where Shift-2 is the quote character: " However, with the amVim plugin installed, when in edit mode, pressing Shift-2 gives the @ symbol. Further, the @ key gives the ". This is consistent with an American keyboard, but inconsistent with the British one.
from amvim-for-vscode.
I added keyboard layout support here: #45.
It has only the US QWERTY
layout now. Could you help creating layout you need?
All it needs is a file like this:
https://github.com/aioutecism/amVim-for-VSCode/blob/feature/keyboard-layout-support/src/Layouts/US_QWERTY.ts
You may like to check #45 for guidance of creating layout file.
from amvim-for-vscode.
This is very interesting, @aioutecism. So, I need to just map the same characters as you have in the US layout? I see you are missing an identifier on the key between left shift and z on my keyboard (the bottommost layout has 8 keys between shift and vk_oem_comma. In Norwegian keyboard layout, it is used for <>
from amvim-for-vscode.
Should I make a new pull request with the new layout, btw? What branch should I fork off?
from amvim-for-vscode.
The extra key between left shift and z seems to be missing in VSCode's keybinding system.
Cloud you open VSCode's keybindings.json, press Ctrl+K Ctrl+K
and The key between left shift and z
, then take a screenshot for me (like the one below). I may find a workaround.
from amvim-for-vscode.
@erikbra
Please checkout a new branch from feature/keyboard-layout-support
, add the layout file.
Then open a pull request with base: feature/keyboard-layout-support
, head your-branch-name
.
I'll then check if everything works fine and merge it.
from amvim-for-vscode.
It's oem_102.
from amvim-for-vscode.
Thanks. What would show up in your keybindings.json
if you press enter after that?
from amvim-for-vscode.
[{
"key": "oem_102",
"command": "commandId",
"when": "editorTextFocus"
}
]
from amvim-for-vscode.
Thank you.
I added the binding but I'm not sure it will work or not.
fae678e
Please uncomment-out 'vk_oem_102;: '',
and shift+vk_oem_102': '',
in your layout file, then fill in the right character.
BTW, you can test on your machine flowing these steps:
- Clone this repo.
- cd into root and run
npm install
. - Open root folder in VSCode.
- Create your layout file.
- Press
F5
to test it out.
from amvim-for-vscode.
Will test, thanks.
from amvim-for-vscode.
Just to be clear, @aioutecism , is it the "right side" of the map that's important, or the actual key (the "left side")? Because e.g. @ is not on any of the keys in the map on my keyboard (it's ctrl+alt+2)
from amvim-for-vscode.
Please only change the right side of map.
Leave the left side as they are or the map won't work.
from amvim-for-vscode.
I have a problem with vk_oem_6. On my keyboard, it is a "dead key", i.e. it doesn't map directly to a character, only an accent, which is added to the letter typed after it.
E.g.
vk_oem6, then e = ë
shift+vk_oem6, then e = ê
etc
So I'm not sure the "virtual keyboard" approach works when having any dead keys.
https://en.wikipedia.org/wiki/Dead_key
from amvim-for-vscode.
Please comment out vk_oem_6
and shift+vk_oem_6
lines. VSCode should do the rest for us (I hope).
Also, I'm asking a fix to VSCode's keybinding system here if you are interested.
from amvim-for-vscode.
All layout related problems should be solved in 1.0.0.
However, 1.0.0 depends on VSCode >= 0.10.12.
You can download the VSCode insiders version here and install amVim to try it.
from amvim-for-vscode.
Sorry I haven't commented. But on VSCode 1.1.1, everything works as expected. Nice job!!
from amvim-for-vscode.
Related Issues (20)
- release 1.33.0 and publish to extension marketplace HOT 2
- release 1.34.0 and publish to extension marketplace HOT 5
- Vgg does not work HOT 5
- Add the macro feature in amVim it's the most wanted feature right now!!!! HOT 1
- apply powerline theme HOT 1
- Is this project still active? HOT 2
- `o` Motion Cursor Position Incorrect HOT 22
- yy on line without trailing newline should insert a newline on p
- switching to visual mode and going down puts the cursor one to the right of where it should be
- Add Horizontal split HOT 1
- :set filetype could open language selector
- Some commands are (sometimes) broken in VS Code 1.75.0+ HOT 9
- Cannot switch out Normal mode in long file HOT 5
- feature request: distinct VScode mode to ignore amVim commands HOT 1
- Gets locked in 'shift' mode HOT 2
- Remapping jump to next section HOT 1
- `z.` command should jump to first non blank
- [Feature] Toggle Binding HOT 1
- is it possible to add Ctrl-A/Ctrl-X ?
- I would like to ask why I can't use select mode in vscode here?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amvim-for-vscode.