|
libmsx
C library for MSX
|
Get Joypad button state. More...
Collaboration diagram for Joystick / Joypad inteface:Macros | |
| #define | VK_UP (1 << 0) |
| Bitmask for UP direction of joystick or UP arrow key. | |
| #define | VK_DOWN (1 << 1) |
| Bitmask for DOWN direction of joystick or DOWN arrow key. | |
| #define | VK_LEFT (1 << 2) |
| Bitmask for LEFT direction of joystick or LEFT arrow key. | |
| #define | VK_RIGHT (1 << 3) |
| Bitmask for RIGHT direction of joystick or RIGHT arrow key. | |
| #define | VK_FIRE_0 (1 << 4) |
| Bitmask for trigger button #1 or SPACE key. | |
| #define | VK_FIRE_1 (1 << 5) |
| Bitmask for trigger button #2. | |
Functions | |
| uint8_t | joypad_get_state (uint8_t controller) |
MSX Get the status of the joystick buttons and levers. | |
Get Joypad button state.
| #define VK_UP (1 << 0) |
Bitmask for UP direction of joystick or UP arrow key.
| #define VK_DOWN (1 << 1) |
Bitmask for DOWN direction of joystick or DOWN arrow key.
| #define VK_LEFT (1 << 2) |
Bitmask for LEFT direction of joystick or LEFT arrow key.
| #define VK_RIGHT (1 << 3) |
Bitmask for RIGHT direction of joystick or RIGHT arrow key.
| #define VK_FIRE_0 (1 << 4) |
Bitmask for trigger button #1 or SPACE key.
| #define VK_FIRE_1 (1 << 5) |
| uint8_t joypad_get_state | ( | uint8_t | controller | ) |
MSX Get the status of the joystick buttons and levers.
Get the status of the two trigger buttons and eight-way lever of the specified joystick (or SPACE key and arrow keys of the keyboard).
| controller | joystick number
|
1 if corresponding buttons / keys were pressed or will be 0 if released.bit #0 : VK_UPbit #1 : VK_DOWNbit #2 : VK_LEFTbit #3 : VK_RIGHTbit #4 : VK_FIRE_0bit #5 : VK_FIRE_1VK_UP | VK_RIGHT | VK_FIRE_0 will be returned).