Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 689538
Collapse All | Expand All

(-)hatari-2.1.0.old/src/gui-sdl/sdlgui.c (-1 / +17 lines)
Lines 1329-1340 Link Here
1329
				}
1329
				}
1330
				break;
1330
				break;
1331
1331
1332
			 case SDL_JOYHATMOTION:
1333
				if (sdlEvent.jhat.value & SDL_HAT_LEFT)
1334
					retbutton = SDLGui_HandleShortcut(dlg, SG_SHORTCUT_LEFT);
1335
				else if (sdlEvent.jhat.value & SDL_HAT_RIGHT)
1336
					retbutton = SDLGui_HandleShortcut(dlg, SG_SHORTCUT_RIGHT);
1337
				if (sdlEvent.jhat.value & SDL_HAT_UP)
1338
				{
1339
					SDLGui_RemoveFocus(dlg, focused);
1340
					focused = SDLGui_FocusNext(dlg, focused, -1);
1341
				}
1342
				else if (sdlEvent.jhat.value & SDL_HAT_DOWN)
1343
				{
1344
					SDLGui_RemoveFocus(dlg, focused);
1345
					focused = SDLGui_FocusNext(dlg, focused, +1);
1346
				}
1347
				break;
1348
1332
			 case SDL_JOYBUTTONDOWN:
1349
			 case SDL_JOYBUTTONDOWN:
1333
				retbutton = SDLGui_HandleSelection(dlg, focused, focused);
1350
				retbutton = SDLGui_HandleSelection(dlg, focused, focused);
1334
				break;
1351
				break;
1335
1352
1336
			 case SDL_JOYBALLMOTION:
1353
			 case SDL_JOYBALLMOTION:
1337
			 case SDL_JOYHATMOTION:
1338
			 case SDL_MOUSEMOTION:
1354
			 case SDL_MOUSEMOTION:
1339
				break;
1355
				break;
1340
1356
(-)hatari-2.1.0.old/src/joy.c (+11 lines)
Lines 199-207 Link Here
199
 */
199
 */
200
static bool Joy_ReadJoystick(int nSdlJoyID, JOYREADING *pJoyReading)
200
static bool Joy_ReadJoystick(int nSdlJoyID, JOYREADING *pJoyReading)
201
{
201
{
202
	unsigned hat = SDL_JoystickGetHat(sdlJoystick[nSdlJoyID], 0);
203
202
	/* Joystick is OK, read position from the configured joystick axis */
204
	/* Joystick is OK, read position from the configured joystick axis */
203
	pJoyReading->XPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->XAxisID);
205
	pJoyReading->XPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->XAxisID);
204
	pJoyReading->YPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->YAxisID);
206
	pJoyReading->YPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->YAxisID);
207
	/* Similarly to other emulators that support hats, override axis readings with hats */
208
	if (hat & SDL_HAT_LEFT)
209
		pJoyReading->XPos = -32768;
210
	if (hat & SDL_HAT_RIGHT)
211
		pJoyReading->XPos = 32767;
212
	if (hat & SDL_HAT_UP)
213
		pJoyReading->YPos = -32768;
214
	if (hat & SDL_HAT_DOWN)
215
		pJoyReading->YPos = 32767;
205
	/* Sets bit #0 if button #1 is pressed: */
216
	/* Sets bit #0 if button #1 is pressed: */
206
	pJoyReading->Buttons = SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 0);
217
	pJoyReading->Buttons = SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 0);
207
	/* Sets bit #1 if button #2 is pressed: */
218
	/* Sets bit #1 if button #2 is pressed: */

Return to bug 689538