Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a single cross-platform
KeyCode
enum
We used to have a different `KeyCode` enum on every platform making it unnecessarily hard to specify hotkeys in a cross platform manner. Here we merge them all together into a single `KeyCode` enum. It is based on the [UI Events KeyboardEvent code Values](https://www.w3.org/TR/uievents-code/) web standard. This also meant we now had to map the values from the individual operating systems to these values. For this we use the tables on [MSDN - KeyboardEvent: code values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values). There are a few additional and alternative values, so the `KeyCode` enum and its parsing got extended a bit beyond the standard to handle these. The implementation for Windows and Linux also slightly changed. Both of these used to use Keyboard layout specific hotkeys, which isn't what we want. We may however want to introduce a way to resolve the hotkeys to the current Keyboard layout for visualization purposes in the future.
- Loading branch information