Rebase against aa629c4c7225166f4ee46476d98702df2e142711.

This commit is contained in:
Alistair Leslie-Hughes
2021-10-01 08:34:59 +10:00
parent 7f9b324dea
commit c4535e89f7
6 changed files with 55 additions and 208 deletions

View File

@@ -1,4 +1,4 @@
From 7d5631535b26bea474584a75254da6d91e623e4f Mon Sep 17 00:00:00 2001
From 58773ad5cf6a79a6ec4fc2856aeb5fdf3f877368 Mon Sep 17 00:00:00 2001
From: Andrew Church <achurch@achurch.org>
Date: Mon, 25 Feb 2019 11:21:03 +1100
Subject: [PATCH] dinput: Allow remapping of joystick buttons
@@ -18,10 +18,10 @@ Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=35815
5 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index d4f5b819471..e1fc80f41bf 100644
index c85fda5cddb..21c81b0b683 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -883,6 +883,7 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
@@ -921,6 +921,7 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
int tokens = 0;
int axis = 0;
int pov = 0;
@@ -29,7 +29,7 @@ index d4f5b819471..e1fc80f41bf 100644
get_app_key(&hkey, &appkey);
@@ -894,6 +895,34 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
@@ -932,6 +933,34 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
TRACE("setting default deadzone to: \"%s\" %d\n", buffer, This->deadzone);
}
@@ -65,7 +65,7 @@ index d4f5b819471..e1fc80f41bf 100644
if (!This->axis_map) return DIERR_OUTOFMEMORY;
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index c439cca81c3..d1194197f66 100644
index 5b54e352c20..7a7a59bcb58 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -735,10 +735,13 @@ static void joy_polldev( IDirectInputDevice8W *iface )
@@ -85,10 +85,10 @@ index c439cca81c3..d1194197f66 100644
else if (jse.type & JS_EVENT_AXIS)
{
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 8279ffbf74a..a6a658ac57b 100644
index e3876a97b7f..aa56aa28d08 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -742,6 +742,8 @@ static void joy_polldev( IDirectInputDevice8W *iface )
@@ -820,6 +820,8 @@ static void joy_polldev( IDirectInputDevice8W *iface )
if (btn & 0x80)
{
btn &= 0x7F;
@@ -98,11 +98,11 @@ index 8279ffbf74a..a6a658ac57b 100644
This->generic.js.rgbButtons[btn] = value = ie.value ? 0x80 : 0x00;
}
diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index e8732bd696c..866df41c392 100644
index 9ee45e8a445..f88ee566781 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -838,6 +838,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal);
@@ -891,6 +891,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
TRACE("val %d oldVal %d newVal %d\n", val, oldVal, newVal);
if (oldVal != newVal)
{
+ button_idx = device->generic.button_map[button_idx];
@@ -111,7 +111,7 @@ index e8732bd696c..866df41c392 100644
queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++);
if (device->generic.base.hEvent)
diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h
index 4fe51d17067..01b35fa40fc 100644
index 32265edef03..fb0edfa7878 100644
--- a/dlls/dinput/joystick_private.h
+++ b/dlls/dinput/joystick_private.h
@@ -33,6 +33,9 @@