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

Make Neo keyboard layout (layer 4) arrow keys work in explorer view #98269

Conversation

MaxGyver83
Copy link
Contributor

This PR fixes #97946.

The Neo2 keyboard layout (and others) have special keys (arrow keys, page up/down, tab, return, escape, ...) on layer 4. For example: AltGr+D = DownArrow. This bugfix makes the explorer view behave as expected if such a layer 4 down arrow (or any other arrow) is pressed.

grafik

For testing:

  • Activate for example the keyboard layout Neo_qwerty in Linux: setxkbmap de neo_qwerty
  • Set Keyboard: Dispatch to keyCode
  • Click into the explorer view
  • Press AltGr + E or D for going up and down
  • Press AltGr + S or F for folding/unfolding folders

@@ -707,7 +707,7 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
.map(e => new StandardKeyboardEvent(e))
.filter(this.keyboardNavigationEventFilter || (() => true))
.filter(() => this.automaticKeyboardNavigation || this.triggered)
.filter(e => this.keyboardNavigationDelegate.mightProducePrintableCharacter(e) || ((this.pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? (e.altKey && !e.metaKey) : e.ctrlKey) && !e.shiftKey)))
.filter(e => this.keyboardNavigationDelegate.mightProducePrintableCharacter(e) && !(e.keyCode === KeyCode.DownArrow || e.keyCode === KeyCode.UpArrow || e.keyCode === KeyCode.LeftArrow || e.keyCode === KeyCode.RightArrow) || ((this.pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? (e.altKey && !e.metaKey) : e.ctrlKey) && !e.shiftKey)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of having && in the same level as || as it might appear ambiguous to unsuspecting readers. Please make it explicit by wrapping what needs to be wrapped in parenthesis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I made a commit for that. Thanks for your review!

…fix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view

Merge master from upstream in order to pass the Azure pipeline run for
macOS.
…fix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view

Merging upstream master again because checks failed for Windows, Linux
and macOS.
…fix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view

Merge upstream master again in order to be up to date and to pass all
tests.
@MaxGyver83
Copy link
Contributor Author

MaxGyver83 commented May 28, 2020

@joaomoreno : After I have added the parantheses (which didn't change the code logic), some checks failed. But these failures don't seem to be caused by my commits. I already tried merging upstream master several times but the checks keep failing (although the failures vary).

What can I do?

…fix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view

Getting up to date.
@joaomoreno joaomoreno added this to the May 2020 milestone May 29, 2020
@joaomoreno
Copy link
Member

All good, thanks for this! 🍻

@joaomoreno joaomoreno merged commit d59b031 into microsoft:master May 29, 2020
@MaxGyver83
Copy link
Contributor Author

Thank you for merging! 👍🏻

@MaxGyver83 MaxGyver83 deleted the bugfix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view branch June 1, 2020 13:06
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Neo keyboard layout: Arrow keys don't work in Explorer
2 participants