TS KeyCode枚举、TS键盘事件枚举

常用的keyCode值

keyCode键码值
TS KeyCode枚举、TS键盘事件枚举

为方便日常开发,把键码值写入枚举,省去百度查键码值或打断点的方法

export const enum KeyCode {
    Tab = 9,
    Clear = 12,
    Enter = 13,
    Shift_L = 16,
    Control_L = 17,
    Alt_L = 18,
    Pause = 19,
    Caps_Lock = 20,
    Escape = 27,
    space = 32,
    Prior = 33,
    Next = 34,
    End = 35,
    Home = 36,
    Left = 37,
    Up = 38,
    Right = 39,
    Down = 40,
    Select = 41,
    Print = 42,
    Execute = 43,
    Insert = 45,
    Delete = 46,
    Help = 47,
    equa = 48,
    excla = 49,
    quotedb = 50,
    sectio = 51,
    dollar = 52,
    percent = 53,
    ampersand = 54,
    slas = 55,
    parenlef = 56,
    parenrigh = 57,
    a = 65,
    b = 66,
    c = 67,
    d = 68,
    e = 69,
    f = 70,
    g = 71,
    h = 72,
    i = 73,
    j = 74,
    k = 75,
    l = 76,
    m = 77,
    n = 78,
    o = 79,
    p = 80,
    q = 81,
    r = 82,
    s = 83,
    t = 84,
    u = 85,
    v = 86,
    w = 87,
    x = 88,
    y = 89,
    z = 90,
    KP_0 = 96,
    KP_1 = 97,
    KP_2 = 98,
    KP_3 = 99,
    KP_4 = 100,
    KP_5 = 101,
    KP_6 = 102,
    KP_7 = 103,
    KP_8 = 104,
    KP_9 = 105,
    KP_Multiply = 106,
    KP_Add = 107,
    KP_Separator = 108,
    KP_Subtract = 109,
    KP_Decimal = 110,
    KP_Divide = 111,
    F1 = 112,
    F2 = 113,
    F3 = 114,
    F4 = 115,
    F5 = 116,
    F6 = 117,
    F7 = 118,
    F8 = 119,
    F9 = 120,
    F10 = 121,
    F11 = 122,
    F12 = 123,
    F13 = 124,
    F14 = 125,
    F15 = 126,
    F16 = 127,
    F17 = 128,
    F18 = 129,
    F19 = 130,
    F20 = 131,
    F21 = 132,
    F22 = 133,
    F23 = 134,
    F24 = 135,
    Num_Lock = 136,
    Scroll_Lock = 137,
    acute_grave = 187,
    semicolon = 188,
    underscore = 189,
    colon = 190,
    apostrophe = 192,
    hyphen_macron = 210,
    registered = 212,
    guillemotright = 213,
    ordfeminine = 214,
    AE = 215,
    yen = 216,
    exclamdown = 217,
    onehalf_threequarters = 218,
    greater_bar = 220,
    asterisk_asciitilde = 221,
    division = 227,
    Acircumflex = 228,
    Ecircumflex = 229,
    Icircumflex = 230,
    Ocircumflex = 231,
    Ucircumflex = 232,
    Ntilde = 233,
    Yacute = 234,
    Ooblique = 235,
    Aring = 236,
    Ccedilla = 237,
    THORN = 238,
    ETH = 239,
    cedilla_currency = 240,
    Agrave_atilde_Atilde = 241,
    Egrave = 242,
    Igrave = 243,
    Ograve_otilde_Otilde = 244,
    Ugrave = 245,
    Adiaeresis = 246,
    Ediaeresis = 247,
    Idiaeresis = 248,
    Odiaeresis = 249,
    Udiaeresis = 250,
    question_backslash = 251,
    degree = 252,
    sterling = 253,
    Mode_switch = 254,
}

原创文章,作者:ourygey,如若转载,请注明出处:https://ourygey.com/2022/09/21/ts-keycode%e6%9e%9a%e4%b8%be%e3%80%81ts%e9%94%ae%e7%9b%98%e4%ba%8b%e4%bb%b6%e6%9e%9a%e4%b8%be/

发表评论

您的电子邮箱地址不会被公开。