#pragma once

namespace Juliet
{
    // Follow the HID Usage page for USB
    // https://usb.org/sites/default/files/hut1_5.pdf
    // 0 to 256 Is dedicated to Keyboard Usage Page (0x07)
    // 257 to 286 Is dedicated to Consumer Usage Page (0xC)
    // 287 to 511 Is not implemented. Could be used for Mobile or Consoles
    // ScanCode reprensent Physical Keys and Buttons
    enum class ScanCode : uint16
    {
        Unknown     = 0,
        Unsupported = 0,

        A = 4,
        B = 5,
        C = 6,
        D = 7,
        E = 8,
        F = 9,
        G = 10,
        H = 11,
        I = 12,
        J = 13,
        K = 14,
        L = 15,
        M = 16,
        N = 17,
        O = 18,
        P = 19,
        Q = 20,
        R = 21,
        S = 22,
        T = 23,
        U = 24,
        V = 25,
        W = 26,
        X = 27,
        Y = 28,
        Z = 29,

        Num1 = 30,
        Num2 = 31,
        Num3 = 32,
        Num4 = 33,
        Num5 = 34,
        Num6 = 35,
        Num7 = 36,
        Num8 = 37,
        Num9 = 38,
        Num0 = 39,

        Return    = 40,
        Escape    = 41,
        Backspace = 42,
        Tab       = 43,
        Space     = 44,

        Minus        = 45,
        Equals       = 46,
        LeftBracket  = 47,
        RightBracket = 48,
        Backslash    = 49,
        NonUSHash    = 50, // Same as 49 but for ISO keyboards
        Semicolon    = 51,
        Apostrophe   = 52,
        GraveAccent  = 53,
        Comma        = 54,
        Period       = 55,
        Slash        = 56,
        CapsLock     = 57,

        F1  = 58,
        F2  = 59,
        F3  = 60,
        F4  = 61,
        F5  = 62,
        F6  = 63,
        F7  = 64,
        F8  = 65,
        F9  = 66,
        F10 = 67,
        F11 = 68,
        F12 = 69,

        PrintScreen = 70,
        ScrollLock  = 71,
        Pause       = 72,
        Insert      = 73,

        Home       = 74,
        PageUp     = 75,
        Delete     = 76,
        End        = 77,
        PageDown   = 78,
        RightArrow = 79,
        LeftArrow  = 80,
        DownArrow  = 81,
        UpArrow    = 82,

        NumlockClear = 83, // Pc = Numlock / Mac = Clear

        KeyPad_Divide   = 84,
        KeyPad_Multiply = 85,
        KeyPad_Minus    = 86,
        KeyPad_Plus     = 87,
        KeyPad_Enter    = 88,
        KeyPad_Num1     = 89,
        KeyPad_Num2     = 90,
        KeyPad_Num3     = 91,
        KeyPad_Num4     = 92,
        KeyPad_Num5     = 93,
        KeyPad_Num6     = 94,
        KeyPad_Num7     = 95,
        KeyPad_Num8     = 96,
        KeyPad_Num9     = 97,
        KeyPad_Num0     = 98,
        KeyPad_Period   = 99,

        NonUSBackslash = 100, // ISO keyboards only
        Power          = 102, // Some mac have a Power key

        KeyPad_Equals = 103,
        F13           = 104,
        F14           = 105,
        F15           = 106,
        F16           = 107,
        F17           = 108,
        F18           = 109,
        F19           = 110,
        F20           = 111,
        F21           = 112,
        F22           = 113,
        F23           = 114,
        F24           = 115,

        Mute       = 127,
        VolumeUp   = 128,
        VolumeDown = 129,

        KeyPad_Comma = 133,

        International1 = 135, // Mostly used on Asian keyboards
        International2 = 136,
        International3 = 137, // Yen Symbol
        International4 = 138,
        International5 = 139,
        International6 = 140,
        International7 = 141,
        International8 = 142,
        International9 = 143,
        Lang1          = 144, // Hangul (Korean)
        Lang2          = 145, // Hanja (Korean)
        Lang3          = 146, // Katakana (Japanese)
        Lang4          = 147, // Hiragana (Japanese)
        Lang5          = 148, // Zenkaku/Hankaku (Japanese)
        Lang6          = 149, // Unused
        Lang7          = 150, // Unused
        Lang8          = 151, // Unused
        Lang9          = 152, // Unused

        LeftControl    = 224,
        LeftShift      = 225,
        LeftAlt        = 226, // Alt for PC, Option for Mac
        LeftOSCommand  = 227, // Window key for PC, Command for Mac
        RightControl   = 228,
        RightShift     = 229,
        RightAlt       = 230, // Alt Gr for PC, Option for Mac
        RightOSCommand = 231, // Window key for PC, Command for Mac

        Sleep  = 258,
        WakeUp = 259,

        Media_NextTrack     = 267,
        Media_PreviousTrack = 268,
        Media_Stop          = 269,
        Media_Eject         = 270,
        Media_PlayPause     = 271,
        Media_Select        = 272,

        Reserved = 287,

        Count = 512
    };
} // namespace Juliet
