vitasdk
Documentation of the vitasdk
ctrl.h File Reference
#include <psp2kern/types.h>

Go to the source code of this file.

Data Structures

struct  SceCtrlData
 Returned controller data. More...
 
struct  SceCtrlRapidFireRule
 Structure to pass as argument to sceCtrlSetRapidFire. More...
 
struct  SceCtrlActuator
 Structure to pass as argument to sceCtrlSetActuator. More...
 
struct  SceCtrlPortInfo
 Structure to pass as argument to sceCtrlGetControllerPortInfo. More...
 
struct  SceCtrlVirtualControllerDriver
 Structure to pass as argument to ksceCtrlRegisterVirtualControllerDriver. More...
 

Enumerations

enum  SceCtrlErrorCode {
  SCE_CTRL_ERROR_INVALID_ARG = 0x80340001, SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002, SCE_CTRL_ERROR_NO_DEVICE = 0x80340020, SCE_CTRL_ERROR_NOT_SUPPORTED = 0x80340021,
  SCE_CTRL_ERROR_INVALID_MODE = 0x80340022, SCE_CTRL_ERROR_FATAL = 0x803400FF, SCE_CTRL_ERROR_INVALID_ARG = 0x80340001, SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002,
  SCE_CTRL_ERROR_FATAL = 0x803400FF
}
 
enum  SceCtrlButtons {
  SCE_CTRL_SELECT = 0x00000001, SCE_CTRL_L3 = 0x00000002, SCE_CTRL_R3 = 0x00000004, SCE_CTRL_START = 0x00000008,
  SCE_CTRL_UP = 0x00000010, SCE_CTRL_RIGHT = 0x00000020, SCE_CTRL_DOWN = 0x00000040, SCE_CTRL_LEFT = 0x00000080,
  SCE_CTRL_LTRIGGER = 0x00000100, SCE_CTRL_L2 = SCE_CTRL_LTRIGGER, SCE_CTRL_RTRIGGER = 0x00000200, SCE_CTRL_R2 = SCE_CTRL_RTRIGGER,
  SCE_CTRL_L1 = 0x00000400, SCE_CTRL_R1 = 0x00000800, SCE_CTRL_TRIANGLE = 0x00001000, SCE_CTRL_CIRCLE = 0x00002000,
  SCE_CTRL_CROSS = 0x00004000, SCE_CTRL_SQUARE = 0x00008000, SCE_CTRL_INTERCEPTED = 0x00010000, SCE_CTRL_PSBUTTON = SCE_CTRL_INTERCEPTED,
  SCE_CTRL_HEADPHONE = 0x00080000, SCE_CTRL_VOLUP = 0x00100000, SCE_CTRL_VOLDOWN = 0x00200000, SCE_CTRL_POWER = 0x40000000,
  SCE_CTRL_SELECT = 0x00000001, SCE_CTRL_L3 = 0x00000002, SCE_CTRL_R3 = 0x00000004, SCE_CTRL_START = 0x00000008,
  SCE_CTRL_UP = 0x00000010, SCE_CTRL_RIGHT = 0x00000020, SCE_CTRL_DOWN = 0x00000040, SCE_CTRL_LEFT = 0x00000080,
  SCE_CTRL_LTRIGGER = 0x00000100, SCE_CTRL_RTRIGGER = 0x00000200, SCE_CTRL_L1 = 0x00000400, SCE_CTRL_R1 = 0x00000800,
  SCE_CTRL_TRIANGLE = 0x00001000, SCE_CTRL_CIRCLE = 0x00002000, SCE_CTRL_CROSS = 0x00004000, SCE_CTRL_SQUARE = 0x00008000,
  SCE_CTRL_INTERCEPTED = 0x00010000, SCE_CTRL_PSBUTTON = SCE_CTRL_INTERCEPTED, SCE_CTRL_HEADPHONE = 0x00080000, SCE_CTRL_VOLUP = 0x00100000,
  SCE_CTRL_VOLDOWN = 0x00200000, SCE_CTRL_POWER = 0x40000000
}
 Enumeration for the digital controller buttons. More...
 
enum  SceCtrlExternalInputMode {
  SCE_CTRL_TYPE_UNPAIRED = 0, SCE_CTRL_TYPE_PHY = 1, SCE_CTRL_TYPE_VIRT = 2, SCE_CTRL_TYPE_DS3 = 4,
  SCE_CTRL_TYPE_DS4 = 8, SCE_CTRL_TYPE_UNPAIRED = 0, SCE_CTRL_TYPE_PHY = 1, SCE_CTRL_TYPE_VIRT = 2,
  SCE_CTRL_TYPE_DS3 = 4, SCE_CTRL_TYPE_DS4 = 8
}
 Enumeration for the controller types. More...
 
enum  SceCtrlPadInputMode {
  SCE_CTRL_MODE_DIGITAL = 0, SCE_CTRL_MODE_ANALOG = 1, SCE_CTRL_MODE_ANALOG_WIDE = 2, SCE_CTRL_MODE_DIGITAL = 0,
  SCE_CTRL_MODE_ANALOG = 1, SCE_CTRL_MODE_ANALOG_WIDE = 2
}
 Controller mode. More...
 

Functions

int ksceCtrlSetSamplingMode (int mode)
 Set the controller mode. More...
 
int ksceCtrlGetSamplingMode (int *pMode)
 Get the current controller mode. More...
 
int ksceCtrlPeekBufferPositive (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (polling, positive logic). More...
 
int ksceCtrlPeekBufferNegative (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (polling, negative logic). More...
 
int ksceCtrlReadBufferPositive (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (blocking, positive logic). More...
 
int ksceCtrlReadBufferNegative (int port, SceCtrlData *pad_data, int count)
 Get the controller state information (blocking, negative logic). More...
 
int ksceCtrlSetRapidFire (int port, int idx, const SceCtrlRapidFireRule *pRule)
 Set rules for button rapid fire. More...
 
int ksceCtrlClearRapidFire (int port, int idx)
 Clear rules for button rapid fire. More...
 
int ksceCtrlGetControllerPortInfo (SceCtrlPortInfo *info)
 Get controller port information. More...
 
int ksceCtrlSetButtonIntercept (int intercept)
 Sets intercept. More...
 
int ksceCtrlGetButtonIntercept (int *intercept)
 Gets intercept. More...
 
int ksceCtrlSetButtonEmulation (unsigned int port, unsigned char slot, unsigned int userButtons, unsigned int kernelButtons, unsigned int uiMake)
 Emulate buttons for the digital pad. More...
 
int ksceCtrlSetAnalogEmulation (unsigned int port, unsigned char slot, unsigned char user_lX, unsigned char user_lY, unsigned char user_rX, unsigned char user_rY, unsigned char kernel_lX, unsigned char kernel_lY, unsigned char kernel_rX, unsigned char kernel_rY, unsigned int uiMake)
 Emulate values for the analog pad's X- and Y-axis. More...
 
int ksceCtrlRegisterVirtualControllerDriver (SceCtrlVirtualControllerDriver *driver)
 Register virtual controller driver. More...
 
int ksceCtrlUpdateMaskForNonShell (int clear_mask, int set_mask)
 Update ctrl mask for non shell process. More...
 
int ksceCtrlUpdateMaskForAll (int clear_mask, int set_mask)
 Update ctrl mask for all process. More...
 
int ksceCtrlGetMaskForNonShell (uint32_t *mask)
 Get ctrl mask for non shell process. More...
 
int ksceCtrlGetMaskForAll (uint32_t *mask)
 Get ctrl mask for all process. More...