Atlas - SDL_joystick_c.h
Home / ext / SDL2 / src / joystick Lines: 1 | Size: 4423 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2018 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#include "../SDL_internal.h" 22 23/* Useful functions and variables from SDL_joystick.c */ 24#include "SDL_joystick.h" 25 26struct _SDL_JoystickDriver; 27 28/* Initialization and shutdown functions */ 29extern int SDL_JoystickInit(void); 30extern void SDL_JoystickQuit(void); 31 32/* Function to get the next available joystick instance ID */ 33extern SDL_JoystickID SDL_GetNextJoystickInstanceID(void); 34 35/* Initialization and shutdown functions */ 36extern int SDL_GameControllerInitMappings(void); 37extern void SDL_GameControllerQuitMappings(void); 38extern int SDL_GameControllerInit(void); 39extern void SDL_GameControllerQuit(void); 40 41/* Function to get the joystick driver and device index for an API device index */ 42extern SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, struct _SDL_JoystickDriver **driver, int *driver_index); 43 44/* Function to return the device index for a joystick ID, or -1 if not found */ 45extern int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id); 46 47/* Function to extract information from an SDL joystick GUID */ 48extern void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version); 49 50/* Function to return whether a joystick is a PS4 controller */ 51extern SDL_bool SDL_IsJoystickPS4(Uint16 vendor_id, Uint16 product_id); 52 53/* Function to return whether a joystick is a Nintendo Switch Pro controller */ 54extern SDL_bool SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id); 55 56/* Function to return whether a joystick is a Steam Controller */ 57extern SDL_bool SDL_IsJoystickSteamController(Uint16 vendor_id, Uint16 product_id); 58 59/* Function to return whether a joystick is an Xbox 360 controller */ 60extern SDL_bool SDL_IsJoystickXbox360(Uint16 vendor_id, Uint16 product_id); 61 62/* Function to return whether a joystick is an Xbox One controller */ 63extern SDL_bool SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id); 64 65/* Function to return whether a joystick should be ignored */ 66extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid); 67 68/* Function to return whether a joystick name and GUID is a game controller */ 69extern SDL_bool SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid); 70 71/* Function to return whether a game controller should be ignored */ 72extern SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid); 73 74/* Handle delayed guide button on a game controller */ 75extern void SDL_GameControllerHandleDelayedGuideButton(SDL_Joystick *joystick); 76 77/* Internal event queueing functions */ 78extern void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance); 79extern void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance); 80extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick, 81 Uint8 axis, Sint16 value); 82extern int SDL_PrivateJoystickBall(SDL_Joystick * joystick, 83 Uint8 ball, Sint16 xrel, Sint16 yrel); 84extern int SDL_PrivateJoystickHat(SDL_Joystick * joystick, 85 Uint8 hat, Uint8 value); 86extern int SDL_PrivateJoystickButton(SDL_Joystick * joystick, 87 Uint8 button, Uint8 state); 88extern void SDL_PrivateJoystickBatteryLevel(SDL_Joystick * joystick, 89 SDL_JoystickPowerLevel ePowerLevel); 90 91/* Internal sanity checking functions */ 92extern int SDL_PrivateJoystickValid(SDL_Joystick * joystick); 93 94/* vi: set ts=4 sw=4 expandtab: */ 95[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.