mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-22 09:30:32 +00:00
Add support for joystick controller pads (especially DPad)
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
d8e4853971
commit
1577455a67
@ -103,5 +103,8 @@ namespace Gaming {
|
||||
|
||||
virtual void handleJoyButtonDown(SDL_JoyButtonEvent event) {}
|
||||
virtual void handleJoyButtonUp(SDL_JoyButtonEvent event) {}
|
||||
|
||||
virtual void handleControllerButtonDown(SDL_ControllerButtonEvent event) {}
|
||||
virtual void handleControllerButtonUp(SDL_ControllerButtonEvent event) {}
|
||||
};
|
||||
}
|
||||
|
@ -94,6 +94,12 @@ void Game::runLoop() {
|
||||
case SDL_JOYBUTTONUP:
|
||||
handleJoyButtonUp(e.jbutton);
|
||||
break;
|
||||
case SDL_CONTROLLERBUTTONDOWN:
|
||||
handleControllerButtonDown(e.cbutton);
|
||||
break;
|
||||
case SDL_CONTROLLERBUTTONUP:
|
||||
handleControllerButtonUp(e.cbutton);
|
||||
break;
|
||||
case SDL_JOYDEVICEADDED:
|
||||
addJoystick(e);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user