Skip to content
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

Alt + Numpad keybindings insert characters into editor #22364

Open
raffaeler opened this issue Mar 10, 2017 · 11 comments
Open

Alt + Numpad keybindings insert characters into editor #22364

raffaeler opened this issue Mar 10, 2017 · 11 comments
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues windows VS Code on Windows issues
Milestone

Comments

@raffaeler
Copy link

  • VSCode Version: Code 1.10.2 (8076a19, 2017-03-08T14:02:52.799Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
plantuml jebbs 1.2.5
cpptools ms-vscode 0.10.2
debugger-for-chrome msjsdiag 2.6.0
language-vscode-javascript-angular2 nwallace 0.0.11
language-plantuml qhoekman 0.0.3
nativescript Telerik 0.6.1

Old schoold people like me, still want the numlock key disabled. This means that "ALT + arrows" (and using the arrows on the numpad of a desktop keyboard) results in inserting an ascii code instead in addition to the keyboard shortcut defined in VSCode.

Steps to Reproduce:

  1. Open the editor with some text separated by newlines
  2. ALT + Up arrow and ALT + Down arrow move the lines up and down
  3. Now turn off the numlock on the keyboard
  4. repeat the step at point (2):
    ALT + Up Arrow (on the numpad) lead to inserting the character ◘
    ALT + Down Arrow (on the numpad) lead to inserting the character ☻

I expect the behavior is consistent with Visual Studio where ascii characted are never injected on these keyboard combinations.

Thanks

@rebornix rebornix assigned alexdima and unassigned rebornix Apr 6, 2017
@alexdima alexdima added feature-request Request for new features or functionality keybindings VS Code keybinding issues labels Apr 24, 2017
@alexdima alexdima added this to the Backlog milestone Apr 24, 2017
@alexdima alexdima removed their assignment Apr 24, 2017
@BartmanAbyss
Copy link

+1

@chienhsingwu
Copy link

Not just up and down. left at least will insert a character.

@GreenSliper
Copy link

really irritating

@alexdima
Copy link
Member

Minimal repro steps:

{
    "key": "alt+numpad4",
    "command": "actions.find",
    "when": "editorTextFocus"
}

Presing the key combination results in the find widget opening, but then the text is typed into the find widget.

@alexdima alexdima added the windows VS Code on Windows issues label Oct 18, 2021
@alexdima alexdima changed the title Keyboard combination Alt + arrows in the editor Alt + Numpad keybindings insert characters into editor Oct 19, 2021
@DannyVarod
Copy link

It's been 6 years, any solution?

@tmsasaki
Copy link

tmsasaki commented Oct 14, 2023

I use a workaround for this issue (Windows only solution):

image

Now ALT + NUMPAD ARROW is not inserting a character anymore.

@patfinder
Copy link

patfinder commented Jan 29, 2024

I think this is Windows keyboard behavior (Mac, Linux do have similar techniques). So it cannot/should not be "fixed" by VSCode.

This is call Alt-code input. This is purposely used to input special characters using it code.

For those who reach here by searching the way to input Unicode characters, use Word or Wordpad, type [Alt+Character number] to input the character, then you can copy it to VSCode or other editors that support Unicode. I have a more detailed guide here if you want.

@raffaeler
Copy link
Author

I think this is Windows keyboard behavior (Mac, Linux do have similar techniques). So it cannot/should not be "fixed" by VSCode.

This is true only if you have the numlock active. If you turn the numlock off, the behavior of VSCode is wrong.
In fact, if you repeat the same sequence on VS, it works as expected.

@raffaeler
Copy link
Author

BTW, I am now on Ubuntu 24.04. So please consider adopting a x-plat solution.

@DumbCounselor
Copy link

BTW, I am now on Ubuntu 24.04. So please consider adopting a x-plat solution.

Guess the problem will never be fixed by editor.
On Windows i just remapped keys in OS with PowerToys. No problems since then.
May be for linux there are some alternatives.

@raffaeler
Copy link
Author

Guess the problem will never be fixed by editor. On Windows i just remapped keys in OS with PowerToys. No problems since then. May be for linux there are some alternatives.

I can't understand the reason why it should not be fixed in the editor.
After all, the meaining of those keys is indeed semantically different depending on the numlock being on or off. Semantics do matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

10 participants