summaryrefslogtreecommitdiffstats
path: root/src/skel/glfw/glfw.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-09-27 01:36:49 +0200
committereray orçunus <erayorcunus@gmail.com>2020-09-27 01:36:49 +0200
commita5d6c952a7be243a4c20b6aad47116dce0e51625 (patch)
treedf4dd2067111b7c42038ca6189ac0ae6db11d9d6 /src/skel/glfw/glfw.cpp
parentUse enums in aVehicleSettings (diff)
downloadre3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar
re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.gz
re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.bz2
re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.lz
re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.xz
re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.tar.zst
re3-a5d6c952a7be243a4c20b6aad47116dce0e51625.zip
Diffstat (limited to 'src/skel/glfw/glfw.cpp')
-rw-r--r--src/skel/glfw/glfw.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index ef0e7d3f..26208ebf 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -826,12 +826,28 @@ void joysChangeCB(int jid, int event);
bool IsThisJoystickBlacklisted(int i)
{
- const char *joyname = glfwGetJoystickName(i);
+ if (glfwJoystickIsGamepad(i))
+ return false;
+
+ const char* joyname = glfwGetJoystickName(i);
// this is just a keyboard and mouse
// Microsoft Microsoft® 2.4GHz Transceiver v8.0 Consumer Control
// Microsoft Microsoft® 2.4GHz Transceiver v8.0 System Control
- if(strstr(joyname, "2.4GHz Transceiver"))
+ if (strstr(joyname, "2.4GHz Transceiver"))
+ return true;
+ // COMPANY USB Device System Control
+ // COMPANY USB Device Consumer Control
+ if (strstr(joyname, "COMPANY USB"))
+ return true;
+ // i.e. Synaptics TM2438-005
+ if (strstr(joyname, "Synaptics "))
+ return true;
+ // i.e. ELAN Touchscreen
+ if (strstr(joyname, "ELAN "))
+ return true;
+ // i.e. Primax Electronics, Ltd HP Wireless Keyboard Mouse Kit Consumer Control
+ if (strstr(joyname, "Keyboard"))
return true;
return false;
@@ -2031,11 +2047,11 @@ void CapturePad(RwInt32 padID)
// Gamepad axes are guaranteed to return 0.0f if that particular gamepad doesn't have that axis.
if ( glfwPad != -1 ) {
- leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 0 ? axes[0] : 0.0f;
- leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 1 ? axes[1] : 0.0f;
+ leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 1 ? axes[0] : 0.0f;
+ leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 2 ? axes[1] : 0.0f;
- rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 2 ? axes[2] : 0.0f;
- rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 3 ? axes[3] : 0.0f;
+ rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 3 ? axes[2] : 0.0f;
+ rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 4 ? axes[3] : 0.0f;
}
{