Wiki Page Content

Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2014-02-15 21:41:15
Size: 1536
Comment: Created page using content from SDL_hints.h.
Revision 6 as of 2020-10-12 07:02:08
Size: 1701
Editor: gerstrong
Comment: Added example
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from SDL_HINT_ACCEL_AS_JOY
Line 3: Line 4:
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT||
Line 8: Line 8:
= SDL_HINT_ACCEL_AS_JOY =
A hint that specifies whether an Android built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only.
= SDL_HINT_ACCELEROMETER_AS_JOYSTICK =
A hint that specifies whether the Android / iOS built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only.
Line 26: Line 26:
You can add your code example here #include "SDL.h"

int main(int argc, char* argv[])
{
    // This disables the use of gyroscopes as axis device
    SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
}
Line 33: Line 40:
''You can add useful comments here'' The hint is supported for iOS since SDL 2.0.4.

SDL_HINT_ACCELEROMETER_AS_JOYSTICK

A hint that specifies whether the Android / iOS built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only.

Values

0

list only real joysticks and accept input from them

1

list real joysticks along with the accelerometer as if it were a 3 axis joystick (the default)

Default

By default SDL will list real joysticks along with the accelerometer as if it were a 3 axis joystick.

Code Examples

#include "SDL.h"

int main(int argc, char* argv[])
{
    // This disables the use of gyroscopes as axis device
    SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
}

Remarks

The hint is supported for iOS since SDL 2.0.4.

Version

This hint is available since SDL 2.0.2.


CategoryDefine, CategoryHints

None: SDL_HINT_ACCELEROMETER_AS_JOYSTICK (last edited 2020-10-12 07:02:08 by gerstrong)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit