31
31
#ifndef SDL_SENSOR_DISABLED
32
32
#include "../sensor/SDL_sensor_c.h"
33
33
#endif
34
+ #ifndef SDL_ACTIONSET_DISABLED
35
+ #include "../actionset/SDL_actionset_c.h"
36
+ #endif
34
37
#include "../video/SDL_sysvideo.h"
35
38
#include <SDL3/SDL_syswm.h>
36
39
@@ -120,6 +123,17 @@ static void SDLCALL SDL_AutoUpdateSensorsChanged(void *userdata, const char *nam
120
123
121
124
#endif /* !SDL_SENSOR_DISABLED */
122
125
126
+ #ifndef SDL_ACTIONSET_DISABLED
127
+
128
+ static SDL_bool SDL_update_actionset = SDL_TRUE ;
129
+
130
+ static void SDLCALL SDL_AutoUpdateActionSetChanged (void * userdata , const char * name , const char * oldValue , const char * hint )
131
+ {
132
+ SDL_update_actionset = SDL_GetStringBoolean (hint , SDL_TRUE );
133
+ }
134
+
135
+ #endif /* !SDL_ACTIONSET_DISABLED */
136
+
123
137
static void SDLCALL SDL_PollSentinelChanged (void * userdata , const char * name , const char * oldValue , const char * hint )
124
138
{
125
139
SDL_SetEventEnabled (SDL_EVENT_POLL_SENTINEL , SDL_GetStringBoolean (hint , SDL_TRUE ));
@@ -866,6 +880,13 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel)
866
880
}
867
881
#endif
868
882
883
+ #ifndef SDL_ACTIONSET_DISABLED
884
+ /* Check for action set changes */
885
+ if (SDL_update_actionset ) {
886
+ SDL_UpdateActionSet ();
887
+ }
888
+ #endif
889
+
869
890
SDL_SendPendingSignalEvents (); /* in case we had a signal handler fire, etc. */
870
891
871
892
if (push_sentinel && SDL_EventEnabled (SDL_EVENT_POLL_SENTINEL )) {
@@ -985,6 +1006,11 @@ static SDL_bool SDL_events_need_polling(void)
985
1006
(SDL_WasInit (SDL_INIT_SENSOR ) && SDL_update_sensors && SDL_SensorsOpened ());
986
1007
#endif
987
1008
1009
+ #ifndef SDL_ACTIONSET_DISABLED
1010
+ need_polling = need_polling ||
1011
+ (SDL_WasInit (SDL_INIT_ACTIONSET ) && SDL_update_actionset && SDL_ActionSetsOpened ());
1012
+ #endif
1013
+
988
1014
return need_polling ;
989
1015
}
990
1016
@@ -1360,6 +1386,9 @@ int SDL_InitEvents(void)
1360
1386
#endif
1361
1387
#ifndef SDL_SENSOR_DISABLED
1362
1388
SDL_AddHintCallback (SDL_HINT_AUTO_UPDATE_SENSORS , SDL_AutoUpdateSensorsChanged , NULL );
1389
+ #endif
1390
+ #ifndef SDL_ACTIONSET_DISABLED
1391
+ SDL_AddHintCallback (SDL_HINT_AUTO_UPDATE_ACTIONSET , SDL_AutoUpdateActionSetChanged , NULL );
1363
1392
#endif
1364
1393
SDL_AddHintCallback (SDL_HINT_EVENT_LOGGING , SDL_EventLoggingChanged , NULL );
1365
1394
SDL_AddHintCallback (SDL_HINT_POLL_SENTINEL , SDL_PollSentinelChanged , NULL );
@@ -1379,6 +1408,9 @@ void SDL_QuitEvents(void)
1379
1408
SDL_StopEventLoop ();
1380
1409
SDL_DelHintCallback (SDL_HINT_POLL_SENTINEL , SDL_PollSentinelChanged , NULL );
1381
1410
SDL_DelHintCallback (SDL_HINT_EVENT_LOGGING , SDL_EventLoggingChanged , NULL );
1411
+ #ifndef SDL_ACTIONSET_DISABLED
1412
+ SDL_DelHintCallback (SDL_HINT_AUTO_UPDATE_ACTIONSET , SDL_AutoUpdateActionSetChanged , NULL );
1413
+ #endif
1382
1414
#ifndef SDL_JOYSTICK_DISABLED
1383
1415
SDL_DelHintCallback (SDL_HINT_AUTO_UPDATE_JOYSTICKS , SDL_AutoUpdateJoysticksChanged , NULL );
1384
1416
#endif
0 commit comments