diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-14 21:29:23 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-14 21:29:23 +0200 |
commit | 09a0207e55ac8a69639c85997c330ec0f7caf4a6 (patch) | |
tree | f7784f9199ee39054ca94a1f6cf5de880c7c243f /src/skel/glfw | |
parent | more pedattractor (diff) | |
parent | Fix compilation (diff) | |
download | re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.tar re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.tar.gz re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.tar.bz2 re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.tar.lz re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.tar.xz re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.tar.zst re3-09a0207e55ac8a69639c85997c330ec0f7caf4a6.zip |
Diffstat (limited to 'src/skel/glfw')
-rw-r--r-- | src/skel/glfw/glfw.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index e74e83dd..c60c5cd9 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -715,10 +715,23 @@ void scrollCB(GLFWwindow* window, double xoffset, double yoffset); void cursorCB(GLFWwindow* window, double xpos, double ypos); void joysChangeCB(int jid, int event); +bool IsThisJoystickBlacklisted(int i) +{ + 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")) + return true; + + return false; +} + void _InputInitialiseJoys() { for (int i = 0; i <= GLFW_JOYSTICK_LAST; i++) { - if (glfwJoystickPresent(i)) { + if (glfwJoystickPresent(i) && !IsThisJoystickBlacklisted(i)) { if (PSGLOBAL(joy1id) == -1) PSGLOBAL(joy1id) = i; else if (PSGLOBAL(joy2id) == -1) |