PAD: formatting fixes

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-12-13 07:30:23 +01:00 committed by lightningterror
parent b941d16f78
commit 5769ae3e78
3 changed files with 125 additions and 241 deletions

View File

@ -1008,7 +1008,7 @@ if(Linux)
set(Platform_Libs set(Platform_Libs
${LIBUDEV_LIBRARIES} ${LIBUDEV_LIBRARIES}
${X11_LIBRARIES} ${X11_LIBRARIES}
) )
endif() endif()

View File

@ -38,246 +38,128 @@ static std::string KeyName(int pad, int key, int keysym)
switch (keysym) switch (keysym)
{ {
case kVK_ANSI_A: // clang-format off
return "A"; case kVK_ANSI_A: return "A";
case kVK_ANSI_B: case kVK_ANSI_B: return "B";
return "B"; case kVK_ANSI_C: return "C";
case kVK_ANSI_C: case kVK_ANSI_D: return "D";
return "C"; case kVK_ANSI_E: return "E";
case kVK_ANSI_D: case kVK_ANSI_F: return "F";
return "D"; case kVK_ANSI_G: return "G";
case kVK_ANSI_E: case kVK_ANSI_H: return "H";
return "E"; case kVK_ANSI_I: return "I";
case kVK_ANSI_F: case kVK_ANSI_J: return "J";
return "F"; case kVK_ANSI_K: return "K";
case kVK_ANSI_G: case kVK_ANSI_L: return "L";
return "G"; case kVK_ANSI_M: return "M";
case kVK_ANSI_H: case kVK_ANSI_N: return "N";
return "H"; case kVK_ANSI_O: return "O";
case kVK_ANSI_I: case kVK_ANSI_P: return "P";
return "I"; case kVK_ANSI_Q: return "Q";
case kVK_ANSI_J: case kVK_ANSI_R: return "R";
return "J"; case kVK_ANSI_S: return "S";
case kVK_ANSI_K: case kVK_ANSI_T: return "T";
return "K"; case kVK_ANSI_U: return "U";
case kVK_ANSI_L: case kVK_ANSI_V: return "V";
return "L"; case kVK_ANSI_W: return "W";
case kVK_ANSI_M: case kVK_ANSI_X: return "X";
return "M"; case kVK_ANSI_Y: return "Y";
case kVK_ANSI_N: case kVK_ANSI_Z: return "Z";
return "N"; case kVK_ANSI_0: return "0";
case kVK_ANSI_O: case kVK_ANSI_1: return "1";
return "O"; case kVK_ANSI_2: return "2";
case kVK_ANSI_P: case kVK_ANSI_3: return "3";
return "P"; case kVK_ANSI_4: return "4";
case kVK_ANSI_Q: case kVK_ANSI_5: return "5";
return "Q"; case kVK_ANSI_6: return "6";
case kVK_ANSI_R: case kVK_ANSI_7: return "7";
return "R"; case kVK_ANSI_8: return "8";
case kVK_ANSI_S: case kVK_ANSI_9: return "9";
return "S"; case kVK_ANSI_Grave: return "`";
case kVK_ANSI_T: case kVK_ANSI_Minus: return "-";
return "T"; case kVK_ANSI_Equal: return "=";
case kVK_ANSI_U: case kVK_ANSI_LeftBracket: return "[";
return "U"; case kVK_ANSI_RightBracket: return "]";
case kVK_ANSI_V: case kVK_ANSI_Backslash: return "\\";
return "V"; case kVK_ANSI_Semicolon: return ";";
case kVK_ANSI_W: case kVK_ANSI_Quote: return "'";
return "W"; case kVK_ANSI_Comma: return ",";
case kVK_ANSI_X: case kVK_ANSI_Period: return ".";
return "X"; case kVK_ANSI_Slash: return "/";
case kVK_ANSI_Y: case kVK_Escape: return "";
return "Y"; case kVK_Tab: return "";
case kVK_ANSI_Z: case kVK_Delete: return "";
return "Z"; case kVK_ForwardDelete: return "";
case kVK_ANSI_0: case kVK_Return: return "";
return "0"; case kVK_Space: return "";
case kVK_ANSI_1: case kVK_ANSI_KeypadDecimal: return "Keypad .";
return "1"; case kVK_ANSI_KeypadMultiply: return "Keypad *";
case kVK_ANSI_2: case kVK_ANSI_KeypadPlus: return "Keypad +";
return "2"; case kVK_ANSI_KeypadClear: return "";
case kVK_ANSI_3: case kVK_ANSI_KeypadDivide: return "Keypad /";
return "3"; case kVK_ANSI_KeypadEnter: return "";
case kVK_ANSI_4: case kVK_ANSI_KeypadMinus: return "Keypad -";
return "4"; case kVK_ANSI_KeypadEquals: return "Keypad =";
case kVK_ANSI_5: case kVK_ANSI_Keypad0: return "Keypad 0";
return "5"; case kVK_ANSI_Keypad1: return "Keypad 1";
case kVK_ANSI_6: case kVK_ANSI_Keypad2: return "Keypad 2";
return "6"; case kVK_ANSI_Keypad3: return "Keypad 3";
case kVK_ANSI_7: case kVK_ANSI_Keypad4: return "Keypad 4";
return "7"; case kVK_ANSI_Keypad5: return "Keypad 5";
case kVK_ANSI_8: case kVK_ANSI_Keypad6: return "Keypad 6";
return "8"; case kVK_ANSI_Keypad7: return "Keypad 7";
case kVK_ANSI_9: case kVK_ANSI_Keypad8: return "Keypad 8";
return "9"; case kVK_ANSI_Keypad9: return "Keypad 9";
case kVK_ANSI_Grave: case kVK_Command: return "Left ⌘";
return "`"; case kVK_Shift: return "Left ⇧";
case kVK_ANSI_Minus: case kVK_CapsLock: return "";
return "-"; case kVK_Option: return "Left ⌥";
case kVK_ANSI_Equal: case kVK_Control: return "Left ⌃";
return "="; case kVK_RightCommand: return "Right ⌘";
case kVK_ANSI_LeftBracket: case kVK_RightShift: return "Right ⇧";
return "["; case kVK_RightOption: return "Right ⌥";
case kVK_ANSI_RightBracket: case kVK_RightControl: return "Right ⌃";
return "]"; case kVK_Function: return "fn";
case kVK_ANSI_Backslash: case kVK_VolumeUp: return "Volume Up";
return "\\"; case kVK_VolumeDown: return "Volume Down";
case kVK_ANSI_Semicolon: case kVK_Mute: return "Mute";
return ";"; case kVK_F1: return "F1";
case kVK_ANSI_Quote: case kVK_F2: return "F2";
return "'"; case kVK_F3: return "F3";
case kVK_ANSI_Comma: case kVK_F4: return "F4";
return ","; case kVK_F5: return "F5";
case kVK_ANSI_Period: case kVK_F6: return "F6";
return "."; case kVK_F7: return "F7";
case kVK_ANSI_Slash: case kVK_F8: return "F8";
return "/"; case kVK_F9: return "F9";
case kVK_Escape: case kVK_F10: return "F10";
return ""; case kVK_F11: return "F11";
case kVK_Tab: case kVK_F12: return "F12";
return ""; case kVK_F13: return "F13";
case kVK_Delete: case kVK_F14: return "F14";
return ""; case kVK_F15: return "F15";
case kVK_ForwardDelete: case kVK_F16: return "F16";
return ""; case kVK_F17: return "F17";
case kVK_Return: case kVK_F18: return "F18";
return ""; case kVK_F19: return "F19";
case kVK_Space: case kVK_F20: return "F20";
return ""; case kVK_Help: return "Help";
case kVK_ANSI_KeypadDecimal: case kVK_Home: return "";
return "Keypad ."; case kVK_PageUp: return "";
case kVK_ANSI_KeypadMultiply: case kVK_End: return "";
return "Keypad *"; case kVK_PageDown: return "";
case kVK_ANSI_KeypadPlus: case kVK_LeftArrow: return "";
return "Keypad +"; case kVK_RightArrow: return "";
case kVK_ANSI_KeypadClear: case kVK_DownArrow: return "";
return ""; case kVK_UpArrow: return "";
case kVK_ANSI_KeypadDivide: case kVK_ISO_Section: return "Section";
return "Keypad /"; case kVK_JIS_Yen: return "¥";
case kVK_ANSI_KeypadEnter: case kVK_JIS_Underscore: return "_";
return ""; case kVK_JIS_KeypadComma: return "Keypad ,";
case kVK_ANSI_KeypadMinus: case kVK_JIS_Eisu: return "英数";
return "Keypad -"; case kVK_JIS_Kana: return "かな";
case kVK_ANSI_KeypadEquals: default: return "Key " + std::to_string(keysym);
return "Keypad ="; // clang-format on
case kVK_ANSI_Keypad0:
return "Keypad 0";
case kVK_ANSI_Keypad1:
return "Keypad 1";
case kVK_ANSI_Keypad2:
return "Keypad 2";
case kVK_ANSI_Keypad3:
return "Keypad 3";
case kVK_ANSI_Keypad4:
return "Keypad 4";
case kVK_ANSI_Keypad5:
return "Keypad 5";
case kVK_ANSI_Keypad6:
return "Keypad 6";
case kVK_ANSI_Keypad7:
return "Keypad 7";
case kVK_ANSI_Keypad8:
return "Keypad 8";
case kVK_ANSI_Keypad9:
return "Keypad 9";
case kVK_Command:
return "Left ⌘";
case kVK_Shift:
return "Left ⇧";
case kVK_CapsLock:
return "";
case kVK_Option:
return "Left ⌥";
case kVK_Control:
return "Left ⌃";
case kVK_RightCommand:
return "Right ⌘";
case kVK_RightShift:
return "Right ⇧";
case kVK_RightOption:
return "Right ⌥";
case kVK_RightControl:
return "Right ⌃";
case kVK_Function:
return "fn";
case kVK_VolumeUp:
return "Volume Up";
case kVK_VolumeDown:
return "Volume Down";
case kVK_Mute:
return "Mute";
case kVK_F1:
return "F1";
case kVK_F2:
return "F2";
case kVK_F3:
return "F3";
case kVK_F4:
return "F4";
case kVK_F5:
return "F5";
case kVK_F6:
return "F6";
case kVK_F7:
return "F7";
case kVK_F8:
return "F8";
case kVK_F9:
return "F9";
case kVK_F10:
return "F10";
case kVK_F11:
return "F11";
case kVK_F12:
return "F12";
case kVK_F13:
return "F13";
case kVK_F14:
return "F14";
case kVK_F15:
return "F15";
case kVK_F16:
return "F16";
case kVK_F17:
return "F17";
case kVK_F18:
return "F18";
case kVK_F19:
return "F19";
case kVK_F20:
return "F20";
case kVK_Help:
return "Help";
case kVK_Home:
return "";
case kVK_PageUp:
return "";
case kVK_End:
return "";
case kVK_PageDown:
return "";
case kVK_LeftArrow:
return "";
case kVK_RightArrow:
return "";
case kVK_DownArrow:
return "";
case kVK_UpArrow:
return "";
case kVK_ISO_Section:
return "Section";
case kVK_JIS_Yen:
return "¥";
case kVK_JIS_Underscore:
return "_";
case kVK_JIS_KeypadComma:
return "Keypad ,";
case kVK_JIS_Eisu:
return "英数";
case kVK_JIS_Kana:
return "かな";
default:
return "Key " + std::to_string(keysym);
} }
} }
#else #else

View File

@ -2,6 +2,7 @@
// fichier Include Microsoft Visual C++. // fichier Include Microsoft Visual C++.
// Utilis<69> par PAD.rc // Utilis<69> par PAD.rc
// //
// clang-format off
#define IDD_GENERAL 0x366 #define IDD_GENERAL 0x366
#define IDD_CONFIG 0x369 #define IDD_CONFIG 0x369
#define IDD_CONFIG_GUITAR 0x36A #define IDD_CONFIG_GUITAR 0x36A
@ -154,3 +155,4 @@
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif
// clang-format on