Merge pull request #43461 from ccl2of4/fix-linux-joypad-dpad-zeroing
Fix for linux joypad D-pad zeroing
This commit is contained in:
commit
7610945b4a
1 changed files with 4 additions and 4 deletions
|
@ -459,9 +459,9 @@ void JoypadLinux::process_joypads() {
|
|||
case ABS_HAT0X:
|
||||
if (ev.value != 0) {
|
||||
if (ev.value < 0) {
|
||||
joy->dpad |= Input::HAT_MASK_LEFT;
|
||||
joy->dpad = (joy->dpad | Input::HAT_MASK_LEFT) & ~Input::HAT_MASK_RIGHT;
|
||||
} else {
|
||||
joy->dpad |= Input::HAT_MASK_RIGHT;
|
||||
joy->dpad = (joy->dpad | Input::HAT_MASK_RIGHT) & ~Input::HAT_MASK_LEFT;
|
||||
}
|
||||
} else {
|
||||
joy->dpad &= ~(Input::HAT_MASK_LEFT | Input::HAT_MASK_RIGHT);
|
||||
|
@ -473,9 +473,9 @@ void JoypadLinux::process_joypads() {
|
|||
case ABS_HAT0Y:
|
||||
if (ev.value != 0) {
|
||||
if (ev.value < 0) {
|
||||
joy->dpad |= Input::HAT_MASK_UP;
|
||||
joy->dpad = (joy->dpad | Input::HAT_MASK_UP) & ~Input::HAT_MASK_DOWN;
|
||||
} else {
|
||||
joy->dpad |= Input::HAT_MASK_DOWN;
|
||||
joy->dpad = (joy->dpad | Input::HAT_MASK_DOWN) & ~Input::HAT_MASK_UP;
|
||||
}
|
||||
} else {
|
||||
joy->dpad &= ~(Input::HAT_MASK_UP | Input::HAT_MASK_DOWN);
|
||||
|
|
Loading…
Reference in a new issue