#pragma once #include #include #include #include namespace alvin { // Platform-neutral physical key identifiers. Names follow a US QWERTY layout // but they identify key *positions*, the same way evdev codes and Win32 // scan codes do. Use Input::typeText() to produce characters instead. enum class Key : std::uint16_t { Unknown = 0, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, Escape, Enter, Tab, Backspace, Space, Minus, Equal, LeftBracket, RightBracket, Backslash, Semicolon, Apostrophe, Grave, Comma, Period, Slash, CapsLock, NumLock, ScrollLock, LeftShift, RightShift, LeftCtrl, RightCtrl, LeftAlt, RightAlt, LeftSuper, RightSuper, Menu, Insert, Delete, Home, End, PageUp, PageDown, Left, Right, Up, Down, PrintScreen, Pause, Kp0, Kp1, Kp2, Kp3, Kp4, Kp5, Kp6, Kp7, Kp8, Kp9, KpDecimal, KpDivide, KpMultiply, KpSubtract, KpAdd, KpEnter, VolumeMute, VolumeDown, VolumeUp, MediaPlayPause, MediaStop, MediaNext, MediaPrevious, Count_, }; enum class MouseButton : std::uint8_t { Left, Right, Middle, Back, Forward, }; // "ctrl", "a", "f5", "enter", "super", ... (case-insensitive). std::optional keyFromName(std::string_view name); std::string_view keyName(Key key); // Parses a chord such as "ctrl+shift+t" into its keys, modifiers first as written. std::optional> parseChord(std::string_view chord); bool isModifier(Key key); } // namespace alvin