Joystick: Only send joy events when focused.
This changes makes it so that you only receive joystick (and implicitly gamecontroller) input events when your application has keyboard focus. If you'd like to still receive events when your application is in the background, set the SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint to "1". This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1892
This commit is contained in:
parent
c2d84dbad6
commit
e1e1fa3d61
2 changed files with 62 additions and 1 deletions
|
@ -215,6 +215,20 @@ extern "C" {
|
|||
#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
|
||||
|
||||
|
||||
/**
|
||||
* \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
|
||||
*
|
||||
* The default value is "0".
|
||||
*
|
||||
* The variable can be set to the following values:
|
||||
* "0" - Disable joystick & gamecontroller input events when the
|
||||
* application is in the background.
|
||||
* "1" - Enable joystick & gamecontroller input events when the
|
||||
* application is in the backgroumd.
|
||||
*/
|
||||
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
|
||||
|
||||
|
||||
/**
|
||||
* \brief If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it.
|
||||
* This is a debugging aid for developers and not expected to be used by end users. The default is "1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue