vitasdk
Documentation of the vitasdk
ctrl.h
Go to the documentation of this file.
1 
7 #ifndef _PSP2COMMON_CTRL_H_
8 #define _PSP2COMMON_CTRL_H_
9 
10 #include <vitasdk/build_utils.h>
11 #include <psp2common/types.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef enum SceCtrlErrorCode {
23  SCE_CTRL_ERROR_FATAL = 0x803400FF
25 
31 typedef enum SceCtrlButtons {
32  SCE_CTRL_SELECT = 0x00000001,
33  SCE_CTRL_L3 = 0x00000002,
34  SCE_CTRL_R3 = 0x00000004,
35  SCE_CTRL_START = 0x00000008,
36  SCE_CTRL_UP = 0x00000010,
37  SCE_CTRL_RIGHT = 0x00000020,
38  SCE_CTRL_DOWN = 0x00000040,
39  SCE_CTRL_LEFT = 0x00000080,
40  SCE_CTRL_LTRIGGER = 0x00000100,
42  SCE_CTRL_RTRIGGER = 0x00000200,
44  SCE_CTRL_L1 = 0x00000400,
45  SCE_CTRL_R1 = 0x00000800,
46  SCE_CTRL_TRIANGLE = 0x00001000,
47  SCE_CTRL_CIRCLE = 0x00002000,
48  SCE_CTRL_CROSS = 0x00004000,
49  SCE_CTRL_SQUARE = 0x00008000,
50  SCE_CTRL_INTERCEPTED = 0x00010000,
52  SCE_CTRL_HEADPHONE = 0x00080000,
53  SCE_CTRL_VOLUP = 0x00100000,
54  SCE_CTRL_VOLDOWN = 0x00200000,
55  SCE_CTRL_POWER = 0x40000000
57 
66 
68 typedef enum SceCtrlPadInputMode {
76 
78 typedef struct SceCtrlData {
80  uint64_t timeStamp;
82  unsigned int buttons;
84  unsigned char lx;
86  unsigned char ly;
88  unsigned char rx;
90  unsigned char ry;
92  uint8_t up;
94  uint8_t right;
96  uint8_t down;
98  uint8_t left;
100  uint8_t lt;
102  uint8_t rt;
104  uint8_t l1;
106  uint8_t r1;
108  uint8_t triangle;
110  uint8_t circle;
112  uint8_t cross;
114  uint8_t square;
116  uint8_t reserved[4];
117 } SceCtrlData;
119 
121 typedef struct SceCtrlRapidFireRule {
122  unsigned int Mask;
123  unsigned int Trigger;
124  unsigned int Target;
125  unsigned int Delay;
126  unsigned int Make;
127  unsigned int Break;
130 
132 typedef struct SceCtrlActuator {
133  unsigned char small;
134  unsigned char large;
135  uint8_t unk[6];
138 
140 typedef struct SceCtrlPortInfo {
141  uint8_t port[5];
142  uint8_t unk[11];
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* _PSP2COMMON_CTRL_H_ */
unsigned char lx
Left analogue stick, X axis.
Definition: ctrl.h:84
uint8_t up
Up button.
Definition: ctrl.h:92
unsigned char small
Vibration strength of the small motor.
Definition: ctrl.h:133
uint8_t l1
Left button (L1)
Definition: ctrl.h:104
uint8_t circle
Circle button.
Definition: ctrl.h:110
unsigned char ly
Left analogue stick, Y axis.
Definition: ctrl.h:86
uint8_t reserved[4]
Reserved.
Definition: ctrl.h:116
unsigned int Target
Definition: ctrl.h:124
SceCtrlExternalInputMode
Enumeration for the controller types.
Definition: ctrl.h:59
unsigned char large
Vibration strength of the large motor.
Definition: ctrl.h:134
unsigned char rx
Right analogue stick, X axis.
Definition: ctrl.h:88
unsigned int Break
Definition: ctrl.h:127
SceCtrlErrorCode
Definition: ctrl.h:17
SceCtrlPadInputMode
Controller mode.
Definition: ctrl.h:68
unsigned int Mask
Definition: ctrl.h:122
unsigned int Delay
Definition: ctrl.h:125
unsigned char ry
Right analogue stick, Y axis.
Definition: ctrl.h:90
SceCtrlButtons
Enumeration for the digital controller buttons.
Definition: ctrl.h:31
uint8_t triangle
Triangle button.
Definition: ctrl.h:108
uint64_t timeStamp
The current read frame.
Definition: ctrl.h:80
uint8_t square
Square button.
Definition: ctrl.h:114
uint8_t lt
Left trigger (L2)
Definition: ctrl.h:100
uint8_t port[5]
Controller type of each port (See SceCtrlExternalInputMode)
Definition: ctrl.h:141
uint8_t cross
Cross button.
Definition: ctrl.h:112
uint8_t rt
Right trigger (R2)
Definition: ctrl.h:102
unsigned int Make
Definition: ctrl.h:126
uint8_t unk[11]
Unknown.
Definition: ctrl.h:142
uint8_t unk[6]
Unknown.
Definition: ctrl.h:135
uint8_t right
Right button.
Definition: ctrl.h:94
unsigned int buttons
Bit mask containing zero or more of SceCtrlButtons.
Definition: ctrl.h:82
unsigned int Trigger
Definition: ctrl.h:123
VITASDK_BUILD_ASSERT_EQ(0x20, SceCtrlData)
uint8_t r1
Right button (R1)
Definition: ctrl.h:106
uint8_t down
Down button.
Definition: ctrl.h:96
uint8_t left
Left button.
Definition: ctrl.h:98
@ SCE_CTRL_TYPE_PHY
Physical controller for VITA.
Definition: ctrl.h:61
@ SCE_CTRL_TYPE_DS3
DualShock 3.
Definition: ctrl.h:63
@ SCE_CTRL_TYPE_UNPAIRED
Unpaired controller.
Definition: ctrl.h:60
@ SCE_CTRL_TYPE_VIRT
Virtual controller for PSTV.
Definition: ctrl.h:62
@ SCE_CTRL_TYPE_DS4
DualShock 4.
Definition: ctrl.h:64
@ SCE_CTRL_ERROR_INVALID_MODE
Definition: ctrl.h:22
@ SCE_CTRL_ERROR_FATAL
Definition: ctrl.h:23
@ SCE_CTRL_ERROR_INVALID_ARG
Definition: ctrl.h:18
@ SCE_CTRL_ERROR_NOT_SUPPORTED
Definition: ctrl.h:21
@ SCE_CTRL_ERROR_NO_DEVICE
Definition: ctrl.h:20
@ SCE_CTRL_ERROR_PRIV_REQUIRED
Definition: ctrl.h:19
@ SCE_CTRL_MODE_DIGITAL
Digital buttons only.
Definition: ctrl.h:70
@ SCE_CTRL_MODE_ANALOG
Digital buttons + Analog support.
Definition: ctrl.h:72
@ SCE_CTRL_MODE_ANALOG_WIDE
Same as SCE_CTRL_MODE_ANALOG, but with larger range for analog sticks.
Definition: ctrl.h:74
@ SCE_CTRL_LTRIGGER
Left trigger.
Definition: ctrl.h:40
@ SCE_CTRL_INTERCEPTED
Input not available because intercepted by another application.
Definition: ctrl.h:50
@ SCE_CTRL_DOWN
Down D-Pad button.
Definition: ctrl.h:38
@ SCE_CTRL_L3
L3 button.
Definition: ctrl.h:33
@ SCE_CTRL_PSBUTTON
Playstation (Home) button.
Definition: ctrl.h:51
@ SCE_CTRL_LEFT
Left D-Pad button.
Definition: ctrl.h:39
@ SCE_CTRL_R3
R3 button.
Definition: ctrl.h:34
@ SCE_CTRL_POWER
Power button.
Definition: ctrl.h:55
@ SCE_CTRL_UP
Up D-Pad button.
Definition: ctrl.h:36
@ SCE_CTRL_VOLUP
Volume up button.
Definition: ctrl.h:53
@ SCE_CTRL_CROSS
Cross button.
Definition: ctrl.h:48
@ SCE_CTRL_L1
L1 button.
Definition: ctrl.h:44
@ SCE_CTRL_R1
R1 button.
Definition: ctrl.h:45
@ SCE_CTRL_R2
R2 button.
Definition: ctrl.h:43
@ SCE_CTRL_RIGHT
Right D-Pad button.
Definition: ctrl.h:37
@ SCE_CTRL_HEADPHONE
Headphone plugged in.
Definition: ctrl.h:52
@ SCE_CTRL_START
Start button.
Definition: ctrl.h:35
@ SCE_CTRL_RTRIGGER
Right trigger.
Definition: ctrl.h:42
@ SCE_CTRL_TRIANGLE
Triangle button.
Definition: ctrl.h:46
@ SCE_CTRL_L2
L2 button.
Definition: ctrl.h:41
@ SCE_CTRL_CIRCLE
Circle button.
Definition: ctrl.h:47
@ SCE_CTRL_SELECT
Select button.
Definition: ctrl.h:32
@ SCE_CTRL_VOLDOWN
Volume down button.
Definition: ctrl.h:54
@ SCE_CTRL_SQUARE
Square button.
Definition: ctrl.h:49
Structure to pass as argument to sceCtrlSetActuator.
Definition: ctrl.h:132
Returned controller data.
Definition: ctrl.h:78
Structure to pass as argument to sceCtrlGetControllerPortInfo.
Definition: ctrl.h:140
Structure to pass as argument to sceCtrlSetRapidFire.
Definition: ctrl.h:121