110 lines
4.9 KiB
C
110 lines
4.9 KiB
C
////////////////////////////////////////////////////////////
|
|
//~ Button helpers
|
|
|
|
String StringFromButton(Button button)
|
|
{
|
|
PERSIST Readonly String names[Button_Count] = {
|
|
[Button_M1] = CompLit("Mouse 1"),
|
|
[Button_M2] = CompLit("Mouse 2"),
|
|
[Button_M3] = CompLit("Mouse 3"),
|
|
[Button_M4] = CompLit("Mouse 4"),
|
|
[Button_M5] = CompLit("Mouse 5"),
|
|
[Button_MWheelUp] = CompLit("Wheel Up"),
|
|
[Button_MWheelDown] = CompLit("Wheel Down"),
|
|
[Button_Escape] = CompLit("Escape"),
|
|
[Button_F1] = CompLit("F1"),
|
|
[Button_F2] = CompLit("F2"),
|
|
[Button_F3] = CompLit("F3"),
|
|
[Button_F4] = CompLit("F4"),
|
|
[Button_F5] = CompLit("F5"),
|
|
[Button_F6] = CompLit("F6"),
|
|
[Button_F7] = CompLit("F7"),
|
|
[Button_F8] = CompLit("F8"),
|
|
[Button_F9] = CompLit("F9"),
|
|
[Button_F10] = CompLit("F10"),
|
|
[Button_F11] = CompLit("F11"),
|
|
[Button_F12] = CompLit("F12"),
|
|
[Button_F13] = CompLit("F13"),
|
|
[Button_F14] = CompLit("F14"),
|
|
[Button_F15] = CompLit("F15"),
|
|
[Button_F16] = CompLit("F16"),
|
|
[Button_F17] = CompLit("F17"),
|
|
[Button_F18] = CompLit("F18"),
|
|
[Button_F19] = CompLit("F19"),
|
|
[Button_F20] = CompLit("F20"),
|
|
[Button_F21] = CompLit("F21"),
|
|
[Button_F22] = CompLit("F22"),
|
|
[Button_F23] = CompLit("F23"),
|
|
[Button_F24] = CompLit("F24"),
|
|
[Button_GraveAccent] = CompLit("~"),
|
|
[Button_0] = CompLit("0"),
|
|
[Button_1] = CompLit("1"),
|
|
[Button_2] = CompLit("2"),
|
|
[Button_3] = CompLit("3"),
|
|
[Button_4] = CompLit("4"),
|
|
[Button_5] = CompLit("5"),
|
|
[Button_6] = CompLit("6"),
|
|
[Button_7] = CompLit("7"),
|
|
[Button_8] = CompLit("8"),
|
|
[Button_9] = CompLit("9"),
|
|
[Button_Minus] = CompLit("Minus"),
|
|
[Button_Equal] = CompLit("Equal"),
|
|
[Button_Backspace] = CompLit("Backspace"),
|
|
[Button_Delete] = CompLit("Delete"),
|
|
[Button_Tab] = CompLit("Tab"),
|
|
[Button_A] = CompLit("A"),
|
|
[Button_B] = CompLit("B"),
|
|
[Button_C] = CompLit("C"),
|
|
[Button_D] = CompLit("D"),
|
|
[Button_E] = CompLit("E"),
|
|
[Button_F] = CompLit("F"),
|
|
[Button_G] = CompLit("G"),
|
|
[Button_H] = CompLit("H"),
|
|
[Button_I] = CompLit("I"),
|
|
[Button_J] = CompLit("J"),
|
|
[Button_K] = CompLit("K"),
|
|
[Button_L] = CompLit("L"),
|
|
[Button_M] = CompLit("M"),
|
|
[Button_N] = CompLit("N"),
|
|
[Button_O] = CompLit("O"),
|
|
[Button_P] = CompLit("P"),
|
|
[Button_Q] = CompLit("Q"),
|
|
[Button_R] = CompLit("R"),
|
|
[Button_S] = CompLit("S"),
|
|
[Button_T] = CompLit("T"),
|
|
[Button_U] = CompLit("U"),
|
|
[Button_V] = CompLit("V"),
|
|
[Button_W] = CompLit("W"),
|
|
[Button_X] = CompLit("X"),
|
|
[Button_Y] = CompLit("Y"),
|
|
[Button_Z] = CompLit("Z"),
|
|
[Button_Space] = CompLit("Space"),
|
|
[Button_Enter] = CompLit("Enter"),
|
|
[Button_Ctrl] = CompLit("Ctrl"),
|
|
[Button_Shift] = CompLit("Shift"),
|
|
[Button_Alt] = CompLit("Alt"),
|
|
[Button_Up] = CompLit("Up"),
|
|
[Button_Left] = CompLit("Left"),
|
|
[Button_Down] = CompLit("Down"),
|
|
[Button_Right] = CompLit("Right"),
|
|
[Button_PageUp] = CompLit("PageUp"),
|
|
[Button_PageDown] = CompLit("PageDown"),
|
|
[Button_Home] = CompLit("Home"),
|
|
[Button_End] = CompLit("End"),
|
|
[Button_ForwardSlash] = CompLit("Slash"),
|
|
[Button_Period] = CompLit("Period"),
|
|
[Button_Comma] = CompLit("Comma"),
|
|
[Button_Quote] = CompLit("Quote"),
|
|
[Button_LeftBracket] = CompLit("Left Bracket"),
|
|
[Button_RightBracket] = CompLit("Right Bracket"),
|
|
[Button_Insert] = CompLit("Insert"),
|
|
[Button_Semicolon] = CompLit("Semicolon"),
|
|
};
|
|
String name = Lit("None");
|
|
if (button > 0 && button < countof(names))
|
|
{
|
|
name = names[button];
|
|
}
|
|
return name;
|
|
}
|