[Bf-blender-cvs] [784517d] master: Joystick: Suppress add/remove device events

Sergey Sharybin noreply at git.blender.org
Wed Dec 31 10:58:02 CET 2014


Commit: 784517dfb9650f284d5f7e283b47233c00183686
Author: Sergey Sharybin
Date:   Wed Dec 31 14:56:42 2014 +0500
Branches: master
https://developer.blender.org/rB784517dfb9650f284d5f7e283b47233c00183686

Joystick: Suppress add/remove device events

Previously they'll be printed to the console as a totally unknown events
together claim this shouldn't have happened which is just misleading.

===================================================================

M	source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp

===================================================================

diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
index 08f4d97..0033c13 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
@@ -124,6 +124,12 @@ void SCA_Joystick::HandleEvents(void)
 				SCA_Joystick::m_instance[sdl_event.jball.which]->OnBallMotion(&sdl_event);
 				break;
 #endif
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+			case SDL_JOYDEVICEADDED:
+			case SDL_JOYDEVICEREMOVED:
+				/* pass */
+				break;
+#endif
 			default:
 				printf("SCA_Joystick::HandleEvents, Unknown SDL event (%d), this should not happen\n", sdl_event.type);
 				break;




More information about the Bf-blender-cvs mailing list