Giter Club home page Giter Club logo

Comments (29)

lf94 avatar lf94 commented on August 11, 2024

That's really interesting, because I use Dvorak and that never happens to me.

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

@erikbra
I can't reproduce this bug on OSX.
What OS do you use?

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

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)

dsc_0004

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.

amvim-vscode-problem

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.

aioutecism avatar aioutecism commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

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.

aioutecism avatar aioutecism commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

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.

aioutecism avatar aioutecism commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

Thanks. Just tell me if you need any more help troubleshooting or testing the issue.

from amvim-for-vscode.

erikbra avatar erikbra commented on August 11, 2024

Any progress on this, @aioutecism? Anything I can do to contribute?

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

@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.

latesr avatar latesr commented on August 11, 2024

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.

aioutecism avatar aioutecism commented on August 11, 2024

@erikbra @latesr

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.

erikbra avatar erikbra commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

Should I make a new pull request with the new layout, btw? What branch should I fork off?

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

@erikbra

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.

keybinding_key-binding-widget

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

@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.

erikbra avatar erikbra commented on August 11, 2024

It's oem_102.

image

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

Thanks. What would show up in your keybindings.json if you press enter after that?

from amvim-for-vscode.

erikbra avatar erikbra commented on August 11, 2024

[{
"key": "oem_102",
"command": "commandId",
"when": "editorTextFocus"
}
]

from amvim-for-vscode.

aioutecism avatar aioutecism commented on August 11, 2024

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:

  1. Clone this repo.
  2. cd into root and run npm install.
  3. Open root folder in VSCode.
  4. Create your layout file.
  5. Press F5 to test it out.

from amvim-for-vscode.

erikbra avatar erikbra commented on August 11, 2024

Will test, thanks.

from amvim-for-vscode.

erikbra avatar erikbra commented on August 11, 2024

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.

aioutecism avatar aioutecism commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

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.

aioutecism avatar aioutecism commented on August 11, 2024

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.

aioutecism avatar aioutecism commented on August 11, 2024

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.

erikbra avatar erikbra commented on August 11, 2024

Sorry I haven't commented. But on VSCode 1.1.1, everything works as expected. Nice job!!

from amvim-for-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.