Updated the deadzone to be 4000 from 0 closes #10
This commit is contained in:
parent
f4090093b6
commit
dc05602d06
1 changed files with 4 additions and 4 deletions
|
@ -95,11 +95,11 @@ void read_joystick(int nr, unsigned int *dir, int *button)
|
||||||
// get joystick direction via dPad or joystick
|
// get joystick direction via dPad or joystick
|
||||||
int hat=SDL_JoystickGetHat(joy,0);
|
int hat=SDL_JoystickGetHat(joy,0);
|
||||||
int val = SDL_JoystickGetAxis(joy, 0);
|
int val = SDL_JoystickGetAxis(joy, 0);
|
||||||
if ((hat & SDL_HAT_RIGHT) || dpadRight || val > 0) right=1;
|
if ((hat & SDL_HAT_RIGHT) || dpadRight || val > 4000) right=1;
|
||||||
if ((hat & SDL_HAT_LEFT) || dpadLeft || val < 0) left=1;
|
if ((hat & SDL_HAT_LEFT) || dpadLeft || val < -4000) left=1;
|
||||||
val = SDL_JoystickGetAxis(joy, 1);
|
val = SDL_JoystickGetAxis(joy, 1);
|
||||||
if ((hat & SDL_HAT_UP) || dpadUp || val < 0) top=1;
|
if ((hat & SDL_HAT_UP) || dpadUp || val < -4000) top=1;
|
||||||
if ((hat & SDL_HAT_DOWN) || dpadDown || val > 0) bot=1;
|
if ((hat & SDL_HAT_DOWN) || dpadDown || val > 4000) bot=1;
|
||||||
if (currprefs.pandora_joyConf)
|
if (currprefs.pandora_joyConf)
|
||||||
{
|
{
|
||||||
if ((buttonX && currprefs.pandora_jump > -1) || SDL_JoystickGetButton(joy, currprefs.pandora_jump))
|
if ((buttonX && currprefs.pandora_jump > -1) || SDL_JoystickGetButton(joy, currprefs.pandora_jump))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue