mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-25 22:19:10 +00:00
Default SDL_HINT_JOYSTICK_GAMEINPUT to "1" on GDK platforms
This commit is contained in:
parent
ed87e7e434
commit
5b6342a00d
3 changed files with 11 additions and 6 deletions
|
@ -1244,9 +1244,11 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* The variable can be set to the following values:
|
* The variable can be set to the following values:
|
||||||
*
|
*
|
||||||
* - "0": GameInput is not used. (default)
|
* - "0": GameInput is not used.
|
||||||
* - "1": GameInput is used.
|
* - "1": GameInput is used.
|
||||||
*
|
*
|
||||||
|
* The default is "1" on GDK platforms, and "0" otherwise.
|
||||||
|
*
|
||||||
* This hint should be set before SDL is initialized.
|
* This hint should be set before SDL is initialized.
|
||||||
*
|
*
|
||||||
* \since This hint is available since SDL 3.0.0.
|
* \since This hint is available since SDL 3.0.0.
|
||||||
|
|
|
@ -28,6 +28,13 @@
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
#include <gameinput.h>
|
#include <gameinput.h>
|
||||||
|
|
||||||
|
// Default value for SDL_HINT_JOYSTICK_GAMEINPUT
|
||||||
|
#if defined(SDL_PLATFORM_GDK)
|
||||||
|
#define SDL_GAMEINPUT_DEFAULT true
|
||||||
|
#else
|
||||||
|
#define SDL_GAMEINPUT_DEFAULT false
|
||||||
|
#endif
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
SDL_GAMEPAD_BUTTON_GAMEINPUT_SHARE = 11
|
SDL_GAMEPAD_BUTTON_GAMEINPUT_SHARE = 11
|
||||||
|
@ -234,7 +241,7 @@ static bool GAMEINPUT_JoystickInit(void)
|
||||||
{
|
{
|
||||||
HRESULT hR;
|
HRESULT hR;
|
||||||
|
|
||||||
if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_GAMEINPUT, false)) {
|
if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_GAMEINPUT, SDL_GAMEINPUT_DEFAULT)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2005,10 +2005,6 @@ int main(int argc, char *argv[])
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_LINUX_DEADZONES, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_LINUX_DEADZONES, "1");
|
||||||
|
|
||||||
#if SDL_PLATFORM_GDK
|
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_GAMEINPUT, "1");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable input debug logging */
|
/* Enable input debug logging */
|
||||||
SDL_SetLogPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_DEBUG);
|
SDL_SetLogPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_DEBUG);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue