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

Delete, Insert, Home, End, PgUp, PgDn, and arrow keys no longer work editor in 1.11 #24107

Closed
cameracker opened this issue Apr 6, 2017 · 24 comments
Assignees
Labels
important Issue identified as high-priority keybindings VS Code keybinding issues linux Issues with VS Code on Linux upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded

Comments

@cameracker
Copy link

cameracker commented Apr 6, 2017

  • VSCode Version: 1.11.0-1488387854
  • OS Version: Ubuntu 16.04.1 LTS

Steps to Reproduce:

  1. Try to use any of Delete, Insert, Home, End, PgUp, PgDn, or arrow keys (UpArrow, DownArrow, LeftArrow, RightArrow) while in the editor
  2. Observe that the editor does not respond.

When I started up Visual Studio Code after upgrading I got a warning that it messed with my keybindings. I've inspected them and I don't see anything that has changed. Downgrading to 1.10.2 resolves the issue.

@mdeter
Copy link

mdeter commented Apr 6, 2017

I just logged in here to post this very same issue. Exact same story here using same Ubuntu version. Downgraded to same as workaround. Showstopper bug. Big test escape!

@cleidigh
Copy link
Contributor

cleidigh commented Apr 6, 2017

Windows appears okay

@chrmarti
Copy link
Contributor

chrmarti commented Apr 6, 2017

Which keyboard layout are you using?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Apr 6, 2017
@jakubszalaty
Copy link

I've the same problem but with keys on numpad keyboard. "Normal" keys work fine.

@cameracker
Copy link
Author

cameracker commented Apr 6, 2017

@chrmarti I'm using default/QWERTY, and the physical keyboard is US English

@MichaelPMattaini
Copy link

I'm seeing the same issue as @CameronAckermanSEL, same Ubuntu version and VScode version.

@mdeter
Copy link

mdeter commented Apr 6, 2017

QWERTY here too. Nothing weird keyboard wise. Cursor keys work in other code windows (like the Search edit boxes) but not in the editor pane.

@alexdima
Copy link
Member

alexdima commented Apr 6, 2017

Hi, can you please try:

Attach what the C++ node module reads

  • open an editor. Run F1 > Developer: Inspect Keyboard Mappings. Save to a file and attach here.

Check what values we get from Chromium

  • Open the define keybindings widget (Keyboard Prefereces -> go to keybindings.json)
  • Press the problematic key
  • Hover over the input field (this shows the raw values we get from the keydown event)
    image
  • The first three values for code, keyCode and key are the values coming in from the browser keydown event

Check what Chromium does on your distribution

  • Install Chromium and visit https://jsfiddle.net/v1gz5c5m/1/ .
  • You could also compare the output with Firefox (the output should be the same, i.e. scan codes should match what you press ).

Read more about keybindings

https://github.com/Microsoft/vscode/wiki/Keybindings

Possible workaround

  • to go back to keyCode based dispatching you can use "keyboard.dispatch": "keyCode"

Related

#21780

Do you use Linux on actual hardware or do you run it in a VM/connect to it via some remoting software?

@alexdima alexdima added the linux Issues with VS Code on Linux label Apr 6, 2017
@cameracker
Copy link
Author

cameracker commented Apr 6, 2017

My mappings are:
vscodeKeyMapping.txt

Chromium is returning the wrong keycodes for some reason:
Up Arrow: Lang3, keyCode 38
Down Arrow: NumpadEnter, Keycode 40
Left Arrow: Convert, Keycode 37
Right Arrow: NonConvert, Keycode 39
Delete: PrintScreen, Keycode 46
Insert: NumpadDivide, Keycode 45
End: Unknown, Keycode 35
Home: IntlRo, Keycode 36
PgDn: ControlRight, Keycode 34
PgUp: Lang4, Keycode 33

In all cases, we are getting the correct Key property.

My linux OS is on physical hardware but I am accessing it over remote desktop XVNC

The work around functions as expected. Thanks!

@alexdima
Copy link
Member

alexdima commented Apr 6, 2017

@CameronAckermanSEL
Thank you, the values for the mapping look somewhat OK. We couldn't detect some keyboard layout information (such as the name of the keyboard layout, but it looks like mappings are somewhat being read.

Given this has been reported once before in #21780 and it turned out to be an issue within Chromium, where we received garbage scan codes, could you please continue the troubleshooting in the following direction:

Check what values we get from Chromium

  • Open the define keybindings widget (Keyboard Prefereces -> go to keybindings.json)
  • Press the problematic key
  • Hover over the input field (this shows the raw values we get from the keydown event)
    image
  • The first three values for code, keyCode and key are the values coming in from the browser keydown event

Check what Chromium does on your distribution

@cameracker
Copy link
Author

@alexandrudima
Here you go!
keydown --- code: ControlRight, keyCode: 34, key: PageDown
keydown --- code: Lang4, keyCode: 33, key: PageUp
keydown --- code: , keyCode: 35, key: End
keydown --- code: IntlRo, keyCode: 36, key: Home
keydown --- code: PrintScreen, keyCode: 46, key: Delete
keydown --- code: NumpadDivide, keyCode: 45, key: Insert
keydown --- code: NonConvert, keyCode: 39, key: ArrowRight
keydown --- code: Convert, keyCode: 37, key: ArrowLeft
keydown --- code: NumpadEnter, keyCode: 40, key: ArrowDown
keydown --- code: Lang3, keyCode: 38, key: ArrowUp

Firefox is totally nonfunctional on my system so maybe someone else can try it, sorry!

@alexdima
Copy link
Member

alexdima commented Apr 6, 2017

@CameronAckermanSEL This confirms that it is indeed a case of invalid values coming in from Chromium in the code field of keydown events. Thanks a lot for following through.

Here is a workaround: force us to go back to keyCode dispatching: Use the following setting "keyboard.dispatch": "keyCode". Restart VS Code.

Could you also pretty please open an issue against Chromium. They might have all the know-how in driving and finding the root cause of this. In other words, code and key should be somewhat equal for PageDown, PageUp, etc. and they are not. They are completely off. I have seen this before in #21780, but the OP from there did not AFAIK follow through with opening an issue against Chromium.

@alexdima alexdima added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Apr 6, 2017
@cameracker
Copy link
Author

@alexandrudima I'm somewhat reluctant to do that because I don't have any domain experience in Chromium or how it's consumed in VSCode, and I'm not sure I'd be able to articulate a functional bug report. It's one thing for me to report something against this project as I'm consuming it directly and seeing a problem here. It's another thing to report a defect in an API that I'm using indirectly at best.

@alexdima
Copy link
Member

alexdima commented Apr 6, 2017

@CameronAckermanSEL

e.g. of bug report:

KeyboardEvent.code value in incorrect under Linux

Steps to reproduce:

  1. Open https://jsfiddle.net/v1gz5c5m/1/ in Chromium version X.
  2. Press PageUp
  3. Chromium sends code: Lang4, keyCode: 33, key: PageUp
    [4. Attach a screenshot and link to this issue too]

Those steps have nothing to do with VS Code and will impact anybody using Chromium or any browser based on Chromium (e.g. Chrome) on Linux.

Someone from the Chromium team will pick up the issue and perhaps ask you more information such that they are able to reproduce (same as I'm doing here).

My problem is: I cannot reproduce this bug. I cannot provide more information to the Chromium developers about the setup that leads to this bug. They are competent, they have an interest for Chromium to work correctly on all platforms and configurations and will ask you the right questions. i.e. I have no clue what OS settings might lead to this bug reproducing, but they might.

@cameracker
Copy link
Author

cameracker commented Apr 6, 2017

https://bugs.chromium.org/p/chromium/issues/detail?id=709242

@alexandrudima Also thanks for helping me with the verbage of that report, really appreciate the assistance.

@mdeter
Copy link

mdeter commented Apr 6, 2017

I reinstalled 1.11 and can confirm the workaround "keyboard.dispatch": "keyCode" resolves the issue.

@AkiraPenguin
Copy link

Maybe It is happen on remote desktop.
I saw it on Xubuntu 16.04 & xrdp 0.9.1-7.
When I used Code on direct desktop, I does not saw problem.

@mdeter
Copy link

mdeter commented Apr 7, 2017

Yes, I am using X2Go on Windows to a remote VM running Linux.

@cameracker
Copy link
Author

There's a high probability that it's related to RDP

@rubyjedi
Copy link

rubyjedi commented Apr 9, 2017

Thanks for this. I can confirm the keyboard.dispatch setting resolved the issue on my system as well. (Fedora 25 w/ MATE Desktop).

@alexdima alexdima added the keybindings VS Code keybinding issues label Apr 10, 2017
@alexdima alexdima added the candidate Issue identified as probable candidate for fixing in the next release label Apr 10, 2017
@alexdima alexdima added this to the March Recovery 2017 (2) milestone Apr 10, 2017
alexdima added a commit that referenced this issue Apr 10, 2017
@alexdima alexdima removed the info-needed Issue requires more information from poster label Apr 10, 2017
@alexdima
Copy link
Member

alexdima commented Apr 11, 2017

Can someone please verify this works on the latest Insiders release (from today). i.e. this should now work even without the setting "keyboard.dispatch": "keyCode" on the Insiders build.

@jrieken
Copy link
Member

jrieken commented Apr 12, 2017

verified by code review

@jrieken jrieken added the verified Verification succeeded label Apr 12, 2017
@egamma egamma removed the candidate Issue identified as probable candidate for fixing in the next release label Apr 12, 2017
@yoisel
Copy link

yoisel commented Jul 1, 2017

I am having this issue again with VS Code 1.13.1 on linux (xubuntu 16.04) over xrdp.

@alexdima
Copy link
Member

alexdima commented Jul 4, 2017

@yoisel -- please see https://github.com/Microsoft/vscode/wiki/Keybindings#troubleshoot-linux-keybindings

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
important Issue identified as high-priority keybindings VS Code keybinding issues linux Issues with VS Code on Linux upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests