From dc05602d067fe69058bc0db662971bb03f27af49 Mon Sep 17 00:00:00 2001 From: Chips Date: Tue, 26 Apr 2016 18:38:12 +0000 Subject: [PATCH] Updated the deadzone to be 4000 from 0 closes #10 --- src/od-pandora/joystick.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/od-pandora/joystick.cpp b/src/od-pandora/joystick.cpp index 5e46e7bb..3a41d2b2 100644 --- a/src/od-pandora/joystick.cpp +++ b/src/od-pandora/joystick.cpp @@ -95,11 +95,11 @@ void read_joystick(int nr, unsigned int *dir, int *button) // get joystick direction via dPad or joystick int hat=SDL_JoystickGetHat(joy,0); int val = SDL_JoystickGetAxis(joy, 0); - if ((hat & SDL_HAT_RIGHT) || dpadRight || val > 0) right=1; - if ((hat & SDL_HAT_LEFT) || dpadLeft || val < 0) left=1; + if ((hat & SDL_HAT_RIGHT) || dpadRight || val > 4000) right=1; + if ((hat & SDL_HAT_LEFT) || dpadLeft || val < -4000) left=1; val = SDL_JoystickGetAxis(joy, 1); - if ((hat & SDL_HAT_UP) || dpadUp || val < 0) top=1; - if ((hat & SDL_HAT_DOWN) || dpadDown || val > 0) bot=1; + if ((hat & SDL_HAT_UP) || dpadUp || val < -4000) top=1; + if ((hat & SDL_HAT_DOWN) || dpadDown || val > 4000) bot=1; if (currprefs.pandora_joyConf) { if ((buttonX && currprefs.pandora_jump > -1) || SDL_JoystickGetButton(joy, currprefs.pandora_jump))