|
| 1 | +/* |
| 2 | + Simple DirectMedia Layer |
| 3 | + Copyright (C) 1997-2023 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 | +#ifndef SDL_sysactionset_h_ |
| 24 | +#define SDL_sysactionset_h_ |
| 25 | + |
| 26 | +#include "./SDL_actionset_c.h" |
| 27 | + |
| 28 | +/* Only one provider can read each device at a time. |
| 29 | + * For example, if Steam Input is running, SDL Input doesn't need to read any |
| 30 | + * events for SDL_GameController devices. |
| 31 | + */ |
| 32 | +typedef enum |
| 33 | +{ |
| 34 | + ACTIONSET_DEVICE_NONE = 0x0000, |
| 35 | + ACTIONSET_DEVICE_KEYBOARDMOUSE = 0x0001, |
| 36 | + ACTIONSET_DEVICE_CONTROLLER = 0x0002, |
| 37 | + ACTIONSET_DEVICE_TOUCH = 0x0004, |
| 38 | + ACTIONSET_DEVICE_ALL = 0xFFFF |
| 39 | +} ActionSetDeviceMask; |
| 40 | + |
| 41 | +typedef struct SDL_ActionSetProvider |
| 42 | +{ |
| 43 | + ActionSetDeviceMask (*Init)(ActionSetDeviceMask current_mask); |
| 44 | + void (*Quit)(void); |
| 45 | + void (*Update)(void); |
| 46 | +} SDL_ActionSetProvider; |
| 47 | + |
| 48 | +/* Not all of these are available in a given build. Use #ifdefs, etc. */ |
| 49 | +extern SDL_ActionSetProvider STEAMINPUT_provider; |
| 50 | +extern SDL_ActionSetProvider SDLINPUT_provider; |
| 51 | + |
| 52 | +#if defined(__WINDOWS__) || defined(__MACOS__) || defined(__LINUX__) |
| 53 | +#define SDL_ACTIONSET_STEAMINPUT |
| 54 | +#endif |
| 55 | + |
| 56 | +#endif /* SDL_sysactionset_h_ */ |
0 commit comments