Add a way to resolve KeyCode
according to the Keyboard Layout
#456
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.
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:
I initially started implementing this as a free method on
KeyCode
but it will likely for the reasons above need to be a method onHook
/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 theresolve
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). TheHook
/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.The text was updated successfully, but these errors were encountered: