Definition at line 24 of file testhotplug.c.
25{
26 SDL_Joystick *joystick =
NULL;
33
34 for (
i = 1;
i < argc; ++
i) {
37 }
38 }
39
40 if(enable_haptic) {
42 }
43
44
46
48
49
52 exit(1);
53 }
54
55
56
57
58
60 if (enable_haptic)
62
63 while(keepGoing)
64 {
67 {
69 {
72 break;
75 {
76 SDL_Log(
"Only one joystick supported by this test\n");
77 }
78 else
79 {
83 if (enable_haptic)
84 {
86 {
89 {
92 {
96 }
97 } else {
99 }
100 }
101 else
102 {
104 }
105 }
106 }
107 break;
109 if (instance ==
event.jdevice.which)
110 {
112 instance = -1;
113 if(enable_haptic &&
haptic)
114 {
117 }
120 } else {
121 SDL_Log(
"Unknown joystick diconnected\n");
122 }
123 break;
125
126
127
128 if (enable_haptic)
130 break;
133 if(enable_haptic &&
haptic)
134 {
136 }
137 if (
event.jbutton.button == 0) {
138 SDL_Log(
"Exiting due to button press of button 0\n");
140 }
141 break;
144 break;
145 }
146 }
147 }
148
150
151 return 0;
152}
#define SDL_INIT_JOYSTICK
#define SDL_JoystickClose
#define SDL_JoystickIsHaptic
#define SDL_HapticRumbleInit
#define SDL_LogSetPriority
#define SDL_HapticRumblePlay
#define SDL_HapticOpenFromJoystick
#define SDL_JoystickInstanceID
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
A variable that lets you enable joystick (and gamecontroller) events even when your app is in the bac...
@ SDL_LOG_CATEGORY_APPLICATION
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
static SDL_Haptic * haptic
References haptic, i, NULL, SDL_FALSE, SDL_GetError, SDL_HapticClose, SDL_HapticOpenFromJoystick, SDL_HapticRumbleInit, SDL_HapticRumblePlay, SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, SDL_Init, SDL_INIT_HAPTIC, SDL_INIT_JOYSTICK, SDL_INIT_VIDEO, SDL_JOYAXISMOTION, SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP, SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED, SDL_JoystickClose, SDL_JoystickInstanceID, SDL_JoystickIsHaptic, SDL_JoystickName, SDL_JoystickOpen, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogError, SDL_LogSetPriority, SDL_NumHaptics, SDL_NumJoysticks, SDL_PollEvent, SDL_QUIT, SDL_Quit, SDL_SetHint, SDL_strcasecmp, and SDL_TRUE.