~aleteoryx/muditaos

ref: 9acd593d878cc53a9c80b81fec9f6620ce72094d muditaos/module-bsp/bsp/keyboard/key_codes.hpp -rw-r--r-- 2.7 KiB
9acd593d — Wojtek Rzepecki [EGD-7388] Fix unresponsive keyboard 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#pragma once

namespace bsp {

    enum class KeyCodes {
        Undefined = 0,
        NumericKey1 = 31,
        NumericKey2 = 32,
        NumericKey3 = 33,
        NumericKey4 = 41,
        NumericKey5 = 42,
        NumericKey6 = 43,
        NumericKey7 = 51,
        NumericKey8 = 52,
        NumericKey9 = 53,
        NumericKey0 = 62,
        NumericKeyAst = 61,
        NumericKeyPnd = 63,

        JoystickLeft = 11,
        JoystickRight = 13,
        JoystickUp = 2,
        JoystickDown = 22,
        JoystickEnter = 12,

        FnLeft = 21,//1,
        FnRight = 23,//3,

        VolUp = 4,
        VolDown = 14,

        Torch = 24,

        SSwitchUp = 34,
        SSwitchDown = 54,
        SSwitchMid = 44,

        HeadsetOk      = 71,
        HeadsetVolUp   = 72,
        HeadsetVolDown = 73
    };
}

inline const char *c_str(bsp::KeyCodes code)
{
    switch (code) {
    case bsp::KeyCodes::Undefined:
        return "Undefined";
    case bsp::KeyCodes::NumericKey1:
        return "NumericKey1";
    case bsp::KeyCodes::NumericKey2:
        return "NumericKey2";
    case bsp::KeyCodes::NumericKey3:
        return "NumericKey3";
    case bsp::KeyCodes::NumericKey4:
        return "NumericKey4";
    case bsp::KeyCodes::NumericKey5:
        return "NumericKey5";
    case bsp::KeyCodes::NumericKey6:
        return "NumericKey6";
    case bsp::KeyCodes::NumericKey7:
        return "NumericKey7";
    case bsp::KeyCodes::NumericKey8:
        return "NumericKey8";
    case bsp::KeyCodes::NumericKey9:
        return "NumericKey9";
    case bsp::KeyCodes::NumericKey0:
        return "NumericKey0";
    case bsp::KeyCodes::NumericKeyAst:
        return "NumericKeyAst";
    case bsp::KeyCodes::NumericKeyPnd:
        return "NumericKeyPnd";
    case bsp::KeyCodes::JoystickLeft:
        return "JoystickLeft";
    case bsp::KeyCodes::JoystickRight:
        return "JoystickRight";
    case bsp::KeyCodes::JoystickUp:
        return "JoystickUp";
    case bsp::KeyCodes::JoystickDown:
        return "JoystickDown";
    case bsp::KeyCodes::JoystickEnter:
        return "JoystickEnter";
    case bsp::KeyCodes::FnLeft:
        return "FnLeft";
    case bsp::KeyCodes::FnRight:
        return "FnRight";
    case bsp::KeyCodes::VolUp:
        return "VolUp";
    case bsp::KeyCodes::VolDown:
        return "VolDown";
    case bsp::KeyCodes::Torch:
        return "Torch";
    case bsp::KeyCodes::SSwitchUp:
        return "SSwitchUp";
    case bsp::KeyCodes::SSwitchDown:
        return "SSwitchDown";
    case bsp::KeyCodes::SSwitchMid:
        return "SSwitchMid";
    case bsp::KeyCodes::HeadsetOk:
        return "HeadsetOk";
    case bsp::KeyCodes::HeadsetVolUp:
        return "HeadsetVolUp";
    case bsp::KeyCodes::HeadsetVolDown:
        return "HeadsetVolDown";
    }
    return "";
}