summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-16 14:46:43 +0100
committerGitHub <noreply@github.com>2020-11-16 14:46:43 +0100
commit7610945b4ac5bc6877264f38b9ec65353be807e6 (patch)
tree4cf567a53ad35b548bcb39ce7cddebd767dd02d6 /platform
parent3c213d516ded5c24f2d65ae6cec8256b6019a061 (diff)
parentdd021099ff1b071af05a0024d4a5c35db058bd90 (diff)
Merge pull request #43461 from ccl2of4/fix-linux-joypad-dpad-zeroing
Fix for linux joypad D-pad zeroing
Diffstat (limited to 'platform')
-rw-r--r--platform/linuxbsd/joypad_linux.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index fda1358dfd..4a9d0a8181 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -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);