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

Several improvements in browser keyboard handling #5088

Merged
merged 1 commit into from
May 8, 2019

Conversation

spoenemann
Copy link
Contributor

 - #4879: added command to choose a keyboard layout
 - BrowserKeyboardLayoutProvider state is stored in LocalStorage
 - Added several static keyboard layouts

Signed-off-by: Miro Spönemann <miro.spoenemann@typefox.io>
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

works nicely for me:

  • my layout is properly auto-detected even if a connection is not secure
  • i was able to switch a layout with a command
  • layout is preserved between user sessions for a browser properly

Copy link
Contributor

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

works super cool!
no issues on Chrome; on Safari one need to hit a key after the layout was changed in the OS, then it recognizes it and logs Detected keyboard layout from pressed keys: German (Mac) :-)

};
const pcLayouts = this.layoutProvider.allLayoutData
.filter(layout => layout.hardware === 'pc')
.sort((a, b) => compare(a.name, b.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should be same as sort((a, b) => a.name > b.name), I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sort function expects the parameter to return a number:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

@spoenemann spoenemann merged commit 5ff8d79 into master May 8, 2019
@spoenemann spoenemann deleted the msp_keyb_layouts_contrib branch May 8, 2019 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add user interface to manually select a keyboard layout
3 participants