RetroArch
|
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
#include "input_types.h"
#include <boolean.h>
#include <retro_common_api.h>
#include <retro_inline.h>
#include <libretro.h>
#include <retro_miscellaneous.h>
#include "input_defines.h"
#include "../msg_hash.h"
#include "include/hid_types.h"
#include "include/hid_driver.h"
#include "include/gamepad.h"
Go to the source code of this file.
Classes | |
struct | retro_keybind |
struct | rarch_joypad_info |
struct | input_driver |
struct | rarch_joypad_driver |
struct | input_keyboard_ctx_wait |
Macros | |
#define | inherit_joyaxis(binds) (((binds)[x_plus].joyaxis == (binds)[x_minus].joyaxis) || ( (binds)[y_plus].joyaxis == (binds)[y_minus].joyaxis)) |
#define | input_pop_analog_dpad(binds) |
#define | input_push_analog_dpad(binds, mode) |
Typedefs | |
typedef void(* | input_keyboard_line_complete_t) (void *userdata, const char *line) |
typedef bool(* | input_keyboard_press_t) (void *userdata, unsigned code) |
#define inherit_joyaxis | ( | binds | ) | (((binds)[x_plus].joyaxis == (binds)[x_minus].joyaxis) || ( (binds)[y_plus].joyaxis == (binds)[y_minus].joyaxis)) |
#define input_pop_analog_dpad | ( | binds | ) |
input_pop_analog_dpad: : Binds to modify.
Restores binds temporarily overridden by input_push_analog_dpad().
#define input_push_analog_dpad | ( | binds, | |
mode | |||
) |
input_push_analog_dpad: : Binds to modify. : Which analog stick to bind D-Pad to. E.g: ANALOG_DPAD_LSTICK ANALOG_DPAD_RSTICK
Push analog to D-Pad mappings to binds.
Line complete callback. Calls back after return is pressed with the completed line. Line can be NULL.
enum input_action |
enum input_device_type |
enum input_toggle_type |
config_get_input_driver_options:
Get an enumerated list of all input driver names, separated by '|'.
Returns: string listing of all input driver names, separated by '|'.
config_get_joypad_driver_options:
Get an enumerated list of all joypad driver names, separated by '|'.
Returns: string listing of all joypad driver names, separated by '|'.
bool input_config_get_bind_idx | ( | unsigned | port, |
unsigned * | joy_idx_real | ||
) |
void input_conv_analog_id_to_bind_id | ( | unsigned | idx, |
unsigned | ident, | ||
unsigned * | ident_minus, | ||
unsigned * | ident_plus | ||
) |
input_conv_analog_id_to_bind_id: : Analog key index. E.g.:
Takes as input analog key identifiers and converts them to corresponding bind IDs and .
input_driver_find_handle: : index of driver to get handle to.
Returns: handle to input driver at index. Can be NULL if nothing found.
input_driver_find_handle: : index of driver to get handle to.
Returns: handle to input driver at index. Can be NULL if nothing found.
const char* input_driver_find_ident | ( | int | idx | ) |
input_driver_find_ident: : index of driver to get handle to.
Returns: Human-readable identifier of input driver at index. Can be NULL if nothing found.
input_driver_find_ident: : index of driver to get handle to.
Returns: Human-readable identifier of input driver at index. Can be NULL if nothing found.
float* input_driver_get_float | ( | enum input_action | action | ) |
const input_device_driver_t* input_driver_get_joypad_driver | ( | void | ) |
const input_device_driver_t* input_driver_get_sec_joypad_driver | ( | void | ) |
unsigned* input_driver_get_uint | ( | enum input_action | action | ) |
int16_t input_driver_input_state | ( | rarch_joypad_info_t | joypad_info, |
const struct retro_keybind ** | retro_keybinds, | ||
unsigned | port, | ||
unsigned | device, | ||
unsigned | index, | ||
unsigned | id | ||
) |
void input_driver_set | ( | const input_driver_t ** | input, |
void ** | input_data | ||
) |
bool input_driver_set_rumble_state | ( | unsigned | port, |
enum retro_rumble_effect | effect, | ||
uint16_t | strength | ||
) |
input_driver_set_rumble_state: : User number. : Rumble effect. : Strength of rumble effect.
Sets the rumble state. Used by RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE.
const input_driver_t** input_get_double_ptr | ( | void | ) |
const input_driver_t* input_get_ptr | ( | void | ) |
void input_get_state_for_port | ( | void * | data, |
unsigned | port, | ||
input_bits_t * | p_new_state | ||
) |
int16_t input_joypad_analog | ( | const input_device_driver_t * | drv, |
rarch_joypad_info_t | joypad_info, | ||
unsigned | port, | ||
unsigned | idx, | ||
unsigned | ident, | ||
const struct retro_keybind * | binds | ||
) |
input_joypad_analog: : Input device driver handle. : User number. : Analog key index. E.g.:
Gets analog value of analog key identifiers and from user with number with provided keybinds ().
Returns: analog value on success, otherwise 0.
input_joypad_analog: : Input device driver handle. : User number. : Analog key index. E.g.:
Gets analog value of analog key identifiers and from user with number with provided keybinds ().
Returns: analog value on success, otherwise 0.
int16_t input_joypad_axis_raw | ( | const input_device_driver_t * | drv, |
unsigned | port, | ||
unsigned | axis | ||
) |
input_joypad_axis_raw: : Input device driver handle. : Joystick number. : Identifier of axis.
Checks if axis () was being pressed by user with joystick number .
Returns: true (1) if axis was pressed, otherwise false (0).
bool input_joypad_button_raw | ( | const input_device_driver_t * | drv, |
unsigned | port, | ||
unsigned | button | ||
) |
input_joypad_button_raw: : Input device driver handle. : Joystick number. : Identifier of key.
Checks if key () was being pressed by user with joystick number .
Returns: true (1) if key was pressed, otherwise false (0).
bool input_joypad_hat_raw | ( | const input_device_driver_t * | driver, |
unsigned | joypad, | ||
unsigned | hat_dir, | ||
unsigned | hat | ||
) |
const input_device_driver_t* input_joypad_init_driver | ( | const char * | ident, |
void * | data | ||
) |
input_joypad_init_driver: : identifier of driver to initialize.
Initialize a joypad driver of name .
If ident points to NULL or a zero-length string, equivalent to calling input_joypad_init_first().
Returns: joypad driver if found, otherwise NULL.
const input_device_driver_t* input_joypad_init_first | ( | void * | data | ) |
input_joypad_init_first:
Finds first suitable joypad driver and initializes.
Returns: joypad driver if found, otherwise NULL.
const char* input_joypad_name | ( | const input_device_driver_t * | drv, |
unsigned | port | ||
) |
input_joypad_name: : Input device driver handle. : Joystick number.
Gets name of the joystick ().
Returns: name of joystick port.
|
static |
input_joypad_pressed: : Input device driver handle. : User number. : Binds of user. : Identifier of key.
Checks if key () was being pressed by user with number with provided keybinds ().
Returns: true (1) if key was pressed, otherwise false (0).
bool input_joypad_set_rumble | ( | const input_device_driver_t * | drv, |
unsigned | port, | ||
enum retro_rumble_effect | effect, | ||
uint16_t | strength | ||
) |
input_joypad_set_rumble: : Input device driver handle. : User number. : Rumble effect to set. : Strength of rumble effect.
Sets rumble effect with strength .
Returns: true (1) if successful, otherwise false (0).
void input_keys_pressed | ( | void * | data, |
input_bits_t * | p_new_state | ||
) |
input_keys_pressed:
Grab an input sample for this frame.
Returns: Input sample containing a mask of all pressed keys.
bool input_mouse_button_raw | ( | unsigned | port, |
unsigned | id | ||
) |
input_mouse_button_raw: : Mouse number. : Identifier of key (libretro mouse constant).
Checks if key () was being pressed by user with mouse number .
Returns: true (1) if key was pressed, otherwise false (0).
void input_pad_connect | ( | unsigned | port, |
input_device_driver_t * | driver | ||
) |
input_pad_connect: : Joystick number. : handle for joypad driver handling joystick's input
Registers a newly connected pad with RetroArch.
input_poll:
Input polling callback function.
float input_sensor_get_input | ( | unsigned | port, |
unsigned | id | ||
) |
bool input_sensor_set_state | ( | unsigned | port, |
enum retro_sensor_action | action, | ||
unsigned | rate | ||
) |
input_sensor_set_state: : User number. : Sensor action. : Sensor rate update.
Sets the sensor state. Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE.
int16_t input_state | ( | unsigned | port, |
unsigned | device, | ||
unsigned | idx, | ||
unsigned | id | ||
) |
input_state: : user number. : device identifier of user. : index value of user. : identifier of key pressed by user.
Input state callback function.
Returns: Non-zero if the given key (identified by ) was pressed by the user (assigned to ).
joypad_driver_find_handle: : index of driver to get handle to.
Returns: handle to joypad driver at index. Can be NULL if nothing found.
joypad_driver_find_handle: : index of driver to get handle to.
Returns: handle to joypad driver at index. Can be NULL if nothing found.
const char* joypad_driver_find_ident | ( | int | idx | ) |
joypad_driver_find_ident: : index of driver to get handle to.
Returns: Human-readable identifier of joypad driver at index. Can be NULL if nothing found.
joypad_driver_find_ident: : index of driver to get handle to.
Returns: Human-readable identifier of joypad driver at index. Can be NULL if nothing found.