Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Returns the string name for the button code.
- */
- const TString CInputDeviceController::GetButtonName(int buttonCode)
- {
- // Determines the correct name based on the button name.
- switch (buttonCode)
- {
- // These constants are hardcoded with my Logitech controller.
- case 0: return "A";
- case 1: return "B";
- case 2: return "X";
- case 3: return "Y";
- case 9: return "R1";
- case 10: return "L1";
- case 11: return "Up";
- case 12: return "Down";
- case 13: return "Left";
- case 14: return "Right";
- // Fallback is just a 'Button <n>' string.
- default: return "Button " + TString(buttonCode);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment