public enum KeyA key by its physical position, independent of the keyboard layout.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
There is deliberately no second, layout-dependent enum. The names below are the US-QWERTY legends because something has to name a position, but the value identifies the key's place on the keyboard, not the character it produces: on a French AZERTY layout Q is the key labelled A, and on Dvorak W is where , is printed.
That is the right primitive for the two things games do with a keyboard. A binding — WASD movement — wants the physical position, so the shape under the player's left hand is the same on every layout, which is why every engine that shipped a layout-dependent binding system eventually rewrote it. Typing wants the character, and a character is not a key: it may need a dead key, an IME, or several keystrokes to produce. So typed text arrives as TextInput carrying a string, and never as a key code the caller is expected to translate.
The values follow the USB HID usage table for keyboards, which is what SDL, the browser (KeyboardEvent.code) and Windows scancodes all ultimately derive from, so a backend translates by table lookup rather than by a hundred-case switch.
Fields and properties (119)
UnknownNo key, or a key this platform does not report.
ABCDEFGHIJKLMNOPQRSTUVWXYZNumber1The 1 on the number row, not the numeric keypad.
Number2Number3Number4Number5Number6Number7Number8Number9Number0EnterEscapeBackspaceTabSpaceMinusEqualsLeftBracketRightBracketBackslashSemicolonApostropheGraveCommaPeriodSlashCapsLockF1F2F3F4F5F6F7F8F9F10F11F12PrintScreenScrollLockPauseInsertHomePageUpDeleteEndPageDownRightLeftDownUpNumLockKeypadDivideKeypadMultiplyKeypadMinusKeypadPlusKeypadEnterKeypad1Keypad2Keypad3Keypad4Keypad5Keypad6Keypad7Keypad8Keypad9Keypad0KeypadPeriodNonUsBackslashThe extra key next to left shift on ISO keyboards, absent on ANSI ones.
ApplicationThe menu key, and the same physical key Android reports for its menu button.
F13F14F15F16F17F18F19F20F21F22F23F24LeftControlLeftShiftLeftAltLeft Alt, and Option on a Mac.
LeftMetaLeft Windows, Command on a Mac, Super on Linux.
RightControlRightShiftRightAltRight Alt, which is AltGr on layouts that have one.
RightMetaRight Windows, Command on a Mac, Super on Linux.
BackAndroid's hardware back button, and the browser's back gesture.
Used by (13)
- DesktopInputSourceVixen.Platform.Desktop
- HeadlessInputSourceVixen.Platform.Headless
- HeadlessLifecycleTestsVixen.Platform.Headless.Tests
- HeadlessPlatformTestsVixen.Platform.Headless.Tests
- IInputSourceVixen.Platform
- InputKeyTestsVixen.Input.Tests
- PlatformEventVixen.Platform
- PlatformEventBufferTestsVixen.Platform.Tests
- PlatformEventTestsVixen.Platform.Tests
- SdlTranslationVixen.Platform.Desktop
- SdlTranslationTestsVixen.Platform.Desktop.Tests
- PlatformInputTestsVixen.App.Tests
- VixenApplicationTestsVixen.App.Tests