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

Add a way to resolve KeyCode according to the Keyboard Layout #456

Closed
4 tasks done
CryZe opened this issue Oct 7, 2021 · 0 comments · Fixed by #595
Closed
4 tasks done

Add a way to resolve KeyCode according to the Keyboard Layout #456

CryZe opened this issue Oct 7, 2021 · 0 comments · Fixed by #595
Labels
enhancement An improvement for livesplit-core. feature A new user visible feature for livesplit-core. hotkey This is about the hotkey implementation. priority: high This is a high priority issue. work in progress Someone is working on this.

Comments

@CryZe
Copy link
Collaborator

CryZe commented Oct 7, 2021

KeyCode is based on a Keyboard layout independent web specification. This is great as this means the hotkeys will always refer to a very specific key on the Keyboard no matter the operating system or currently active layout. However when visualizing these in some user interface, the user would prefer to see the key as it is on their keyboard.

I have a WIP implementation for all the platforms, but there are some issues:

  • For Linux we need an open X11 connection.
  • In the web the API is actually async, and I don't want to expose it that way in Rust.

I initially started implementing this as a free method on KeyCode but it will likely for the reasons above need to be a method on Hook / HotkeySystem. The reason for this is that for the web we need a point where we start up the Promise that loads the layout map, such that later when we call the resolve method, the result would be available (hopefully, if not we'll just use the fallback implementation, but it resolves basically immediately on the next tick). The Hook / HotkeySystem constructor is the ideal point in time for this. Also since we need an open X11 connection on Linux, we can just reuse the one we already use for the hotkey handling. Thus implementing this as a method seems to work reasonably well on all platforms.

  • Windows
  • macOS
  • Linux
  • Web
@CryZe CryZe added enhancement An improvement for livesplit-core. work in progress Someone is working on this. feature A new user visible feature for livesplit-core. priority: high This is a high priority issue. hotkey This is about the hotkey implementation. labels Oct 7, 2021
@CryZe CryZe added the needs further discussion It is unclear how to progress without making further decisions. label Oct 27, 2021
@CryZe CryZe removed the needs further discussion It is unclear how to progress without making further decisions. label Nov 7, 2022
@CryZe CryZe closed this as completed in #595 Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement for livesplit-core. feature A new user visible feature for livesplit-core. hotkey This is about the hotkey implementation. priority: high This is a high priority issue. work in progress Someone is working on this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant