Guest User

Untitled

a guest
Jan 25th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. /*
  2. Returns the string name for the button code.
  3. */
  4. const TString CInputDeviceController::GetButtonName(int buttonCode)
  5. {
  6.     // Determines the correct name based on the button name.
  7.     switch (buttonCode)
  8.     {
  9.         // These constants are hardcoded with my Logitech controller.
  10.         case 0: return "A";
  11.         case 1: return "B";
  12.         case 2: return "X";
  13.         case 3: return "Y";
  14.         case 9: return "R1";
  15.         case 10: return "L1";
  16.         case 11: return "Up";
  17.         case 12: return "Down";
  18.         case 13: return "Left";
  19.         case 14: return "Right";
  20.         // Fallback is just a 'Button <n>' string.
  21.         default: return "Button " + TString(buttonCode);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment