diff options
author | Sam Lantinga <slouken@libsdl.org> | 2010-08-22 12:39:27 -0700 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2010-08-22 12:39:27 -0700 |
commit | 1f8dacabd7b5e26b173ce323677a4f0071d2e4e6 (patch) | |
tree | 97fc90b74ba948256182925a49b55d767430b124 /src/joystick | |
parent | 66d40ad33399cbcf2387d95453e78cc2f3f5f2d3 (diff) | |
parent | 7d245d0532a411552d3eb4f3f75c4102819c158e (diff) |
Merged Daniel's Google Summer of Code work from SDL-gsoc2010_IME
Diffstat (limited to 'src/joystick')
-rw-r--r-- | src/joystick/nds/SDL_sysjoystick.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/joystick/nds/SDL_sysjoystick.c b/src/joystick/nds/SDL_sysjoystick.c index cdfbdaca..e885a5da 100644 --- a/src/joystick/nds/SDL_sysjoystick.c +++ b/src/joystick/nds/SDL_sysjoystick.c @@ -45,7 +45,7 @@ int SDL_SYS_JoystickInit(void) { SDL_numjoysticks = 1; -
return (1); + return (1); } /* Function to get the device-dependent name of a joystick */ @@ -73,7 +73,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick) return 0; } -
+ /* Function to update the state of a joystick - called as a device poll. * This function shouldn't update the joystick structure directly, * but instead should call SDL_PrivateJoystick*() to deliver events @@ -84,8 +84,8 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { u32 keysd, keysu; int magnitude = 16384; -
- /*scanKeys(); - this is done in PumpEvents, because touch uses it too */
+ + /*scanKeys(); - this is done in PumpEvents, because touch uses it too */ keysd = keysDown(); keysu = keysUp(); @@ -101,61 +101,61 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) if ((keysd & KEY_RIGHT)) { SDL_PrivateJoystickAxis(joystick, 0, magnitude); } -
if ((keysu & (KEY_UP | KEY_DOWN))) { + if ((keysu & (KEY_UP | KEY_DOWN))) { SDL_PrivateJoystickAxis(joystick, 1, 0); } -
if ((keysu & (KEY_LEFT | KEY_RIGHT))) { + if ((keysu & (KEY_LEFT | KEY_RIGHT))) { SDL_PrivateJoystickAxis(joystick, 0, 0); } -
if ((keysd & KEY_A)) { + if ((keysd & KEY_A)) { SDL_PrivateJoystickButton(joystick, 0, SDL_PRESSED); } -
if ((keysd & KEY_B)) { + if ((keysd & KEY_B)) { SDL_PrivateJoystickButton(joystick, 1, SDL_PRESSED); } -
if ((keysd & KEY_X)) { + if ((keysd & KEY_X)) { SDL_PrivateJoystickButton(joystick, 2, SDL_PRESSED); } -
if ((keysd & KEY_Y)) { + if ((keysd & KEY_Y)) { SDL_PrivateJoystickButton(joystick, 3, SDL_PRESSED); } -
if ((keysd & KEY_L)) { + if ((keysd & KEY_L)) { SDL_PrivateJoystickButton(joystick, 4, SDL_PRESSED); } -
if ((keysd & KEY_R)) { + if ((keysd & KEY_R)) { SDL_PrivateJoystickButton(joystick, 5, SDL_PRESSED); } -
if ((keysd & KEY_SELECT)) { + if ((keysd & KEY_SELECT)) { SDL_PrivateJoystickButton(joystick, 6, SDL_PRESSED); } -
if ((keysd & KEY_START)) { + if ((keysd & KEY_START)) { SDL_PrivateJoystickButton(joystick, 7, SDL_PRESSED); } -
if ((keysu & KEY_A)) { + if ((keysu & KEY_A)) { SDL_PrivateJoystickButton(joystick, 0, SDL_RELEASED); } -
if ((keysu & KEY_B)) { + if ((keysu & KEY_B)) { SDL_PrivateJoystickButton(joystick, 1, SDL_RELEASED); } -
if ((keysu & KEY_X)) { + if ((keysu & KEY_X)) { SDL_PrivateJoystickButton(joystick, 2, SDL_RELEASED); } -
if ((keysu & KEY_Y)) { + if ((keysu & KEY_Y)) { SDL_PrivateJoystickButton(joystick, 3, SDL_RELEASED); } -
if ((keysu & KEY_L)) { + if ((keysu & KEY_L)) { SDL_PrivateJoystickButton(joystick, 4, SDL_RELEASED); } -
if ((keysu & KEY_R)) { + if ((keysu & KEY_R)) { SDL_PrivateJoystickButton(joystick, 5, SDL_RELEASED); } -
if ((keysu & KEY_SELECT)) { + if ((keysu & KEY_SELECT)) { SDL_PrivateJoystickButton(joystick, 6, SDL_RELEASED); } -
if ((keysu & KEY_START)) { + if ((keysu & KEY_START)) { SDL_PrivateJoystickButton(joystick, 7, SDL_RELEASED); } -
} +} /* Function to close a joystick after use */ void |