Polyphase Game Engine
Loading...
Searching...
No Matches
InputConstants.h
Go to the documentation of this file.
1#pragma once
2
3#define INPUT_MAX_KEYS 256
4#define INPUT_MAX_TOUCHES 4
5#define INPUT_MAX_GAMEPADS 4
6
7#if PLATFORM_WINDOWS
8#define INPUT_KEYBOARD_SUPPORT 1
9#define INPUT_MOUSE_SUPPORT 1
10#define INPUT_TOUCH_SUPPORT 1
11#define INPUT_GAMEPAD_SUPPORT 1
12#elif PLATFORM_LINUX
13#define INPUT_KEYBOARD_SUPPORT 1
14#define INPUT_MOUSE_SUPPORT 1
15#define INPUT_TOUCH_SUPPORT 1
16#define INPUT_GAMEPAD_SUPPORT 1
17#elif PLATFORM_GAMECUBE
18#define INPUT_KEYBOARD_SUPPORT 0
19#define INPUT_MOUSE_SUPPORT 0
20#define INPUT_TOUCH_SUPPORT 0
21#define INPUT_GAMEPAD_SUPPORT 1
22#elif PLATFORM_WII
23#define INPUT_KEYBOARD_SUPPORT 0
24#define INPUT_MOUSE_SUPPORT 1
25#define INPUT_TOUCH_SUPPORT 1 // Each wiimote IR treated as a separate pointer
26#define INPUT_GAMEPAD_SUPPORT 1
27#elif PLATFORM_3DS
28#define INPUT_KEYBOARD_SUPPORT 0
29#define INPUT_MOUSE_SUPPORT 0
30#define INPUT_TOUCH_SUPPORT 1
31#define INPUT_GAMEPAD_SUPPORT 1
32#elif PLATFORM_ANDROID
33#define INPUT_KEYBOARD_SUPPORT 1
34#define INPUT_MOUSE_SUPPORT 1
35#define INPUT_TOUCH_SUPPORT 1
36#define INPUT_GAMEPAD_SUPPORT 1
37#else
38// Fallback for console/addon platforms (e.g. POLYPHASE_PLATFORM_ADDON targets
39// like PSP) that don't have their own #elif arm. Without these, every
40// `#if INPUT_GAMEPAD_SUPPORT` in the engine silently compiles to false —
41// most notably the `memcpy(mPrevGamepads, mGamepads, ...)` in
42// InputUtils::InputAdvanceFrame, which means mPrevGamepads stays all-zeros
43// forever and IsGamepadButtonJustDown returns TRUE every frame the button
44// is held. Symptom on PSP: a single d-pad press cascades through 2-3 Button
45// widget nav steps because each held frame re-fires the JustDown edge.
46//
47// Console default: gamepad only (no keyboard / mouse / touch hardware on
48// PSP, GameCube, etc.). Touch-capable consoles (Wii IR, 3DS, Vita)
49// override to 1 in their own #elif arm above.
50#define INPUT_KEYBOARD_SUPPORT 0
51#define INPUT_MOUSE_SUPPORT 0
52#define INPUT_TOUCH_SUPPORT 0
53#define INPUT_GAMEPAD_SUPPORT 1
54#endif