OldSchool Library 1.5.1
Loading...
Searching...
No Matches
keys.h File Reference

Controller handling functions in OSLib. More...

Data Structures

union  OSL_KEYLIST
 List of keys. More...
 
struct  OSL_CONTROLLER
 Controller type. More...
 
union  OSL_REMOTEKEYLIST
 List of remote keys. More...
 
struct  OSL_REMOTECONTROLLER
 Remote Controller type. More...
 

Macros

#define oslSetKeyAutorepeat(keys, init, interval)    (osl_keys->autoRepeatMask = keys, osl_keys->autoRepeatInit = init, osl_keys->autoRepeatInterval = interval)
 Sets the auto-repeat parameters for keys.
 
#define oslSetKeyAutorepeatMask(mask)    (osl_keys->autoRepeatMask = mask)
 Sets the key auto-repeat mask.
 
#define oslSetKeyAutorepeatInit(value)    (osl_keys->autoRepeatInit = value)
 Sets the key auto-repeat initialization value.
 
#define oslSetKeyAutorepeatInterval(value)    (osl_keys->autoRepeatInterval = value)
 Sets the key auto-repeat interval value.
 
#define oslSetKeyAnalogToDPad(sensivity)    (osl_keys->analogToDPadSensivity = sensivity)
 Enables or disables automatic redirection from the analog stick to D-pad buttons.
 
#define oslSetRemoteKeyAutorepeat(keys, init, interval)    (osl_remotekeys->autoRepeatMask = keys, osl_remotekeys->autoRepeatInit = init, osl_remotekeys->autoRepeatInterval = interval)
 Sets the auto-repeat parameters for remote keys.
 
#define oslSetRemoteKeyAutorepeatMask(mask)    (osl_remotekeys->autoRepeatMask = mask)
 Sets the remote key auto-repeat mask.
 
#define oslSetRemoteKeyAutorepeatInit(value)    (osl_remotekeys->autoRepeatInit = value)
 Sets the remote key auto-repeat initialization value.
 
#define oslSetRemoteKeyAutorepeatInterval(value)    (osl_remotekeys->autoRepeatInterval = value)
 Sets the remote key auto-repeat interval value.
 

Enumerations

enum  OSL_KEY_BITS {
  OSL_KEY_SELECT = 1 , OSL_KEY_START = 4 , OSL_KEY_UP = 5 , OSL_KEY_RIGHT = 6 ,
  OSL_KEY_DOWN = 7 , OSL_KEY_LEFT = 8 , OSL_KEY_L = 9 , OSL_KEY_R = 10 ,
  OSL_KEY_TRIANGLE = 13 , OSL_KEY_CIRCLE = 14 , OSL_KEY_CROSS = 15 , OSL_KEY_SQUARE = 16 ,
  OSL_KEY_HOME = 17 , OSL_KEY_HOLD = 18 , OSL_KEY_NOTE = 24
}
 One-based key identifiers, as used by oslMake3Buttons. More...
 
enum  OSL_KEY_MASKS
 Mask for each key in the 'value' field. More...
 

Functions

OSL_CONTROLLERoslReadKeys ()
 Reads the current controller state and stores the result in the osl_pad structure.
 
int oslSetReadKeysFunction (int(*sceCtrlReadBufferPositive)(SceCtrlData *pad_data, int count))
 Sets an external function to read keys.
 
int oslUnsetReadKeysFunction ()
 Unsets the function set with oslSetReadKeysFunction.
 
int oslSetHoldForAnalog (int holdForAnalog)
 Decides if HOLD will affect the analog stick.
 
int oslWaitKey ()
 Waits for a key and returns its code.
 
int oslKbhit ()
 Determines whether a key is currently buffered and returns its code.
 
void oslFlushKey ()
 Flushes the key buffer, removing the pending key.
 
OSL_REMOTECONTROLLERoslReadRemoteKeys ()
 Reads the current remote controller state and stores the result in the osl_remote structure.
 
void oslFlushRemoteKey ()
 Flushes the remote key buffer, removing the pending key.
 
int oslIsRemoteExist ()
 Determines whether the remote is plugged in.
 

Variables

OSL_CONTROLLERosl_keys
 Current keys. Only here for compatibility, use osl_pad now.
 
OSL_CONTROLLER osl_pad
 Current keys.
 
OSL_REMOTECONTROLLERosl_remotekeys
 Current remote keys.
 
OSL_REMOTECONTROLLER osl_remote
 Current remote keys.
 

Detailed Description

Controller handling functions in OSLib.

This file provides the controller API: reading the digital keys and the analog stick, the key auto-repeat feature, and the analog to D-pad conversion.