Skip to content

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

Merged
joaomoreno merged 6 commits intomicrosoft:masterfrom
MaxGyver83:bugfix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view
May 29, 2020
Merged

Make Neo keyboard layout (layer 4) arrow keys work in explorer view#98269
joaomoreno merged 6 commits intomicrosoft:masterfrom
MaxGyver83:bugfix/make-neo-keyboard-layout-layer4-arrow-keys-work-in-explorer-view

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

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

@MaxGyver83 MaxGyver83 requested a review from joaomoreno May 26, 2020 12:32
…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