RetroArch
|
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <compat/strl.h>
#include <file/file_path.h>
#include <file/config_file.h>
#include <encodings/utf.h>
#include <string/stdstring.h>
#include <retro_assert.h>
#include "input_mapper.h"
#include "input_driver.h"
#include "input_keymaps.h"
#include "input_remapping.h"
#include "../config.def.keybinds.h"
#include "../msg_hash.h"
#include "../configuration.h"
#include "../file_path_special.h"
#include "../driver.h"
#include "../retroarch.h"
#include "../movie.h"
#include "../list_special.h"
#include "../verbosity.h"
#include "../tasks/tasks_internal.h"
#include "../command.h"
#include "include/gamepad.h"
Classes | |
struct | input_bind_map |
struct | turbo_buttons |
struct | input_keyboard_line |
Macros | |
#define | DECLARE_BIND(x, bind, desc) { true, 0, #x, desc, bind } |
#define | DECLARE_META_BIND(level, x, bind, desc) { true, level, #x, desc, bind } |
#define | check_input_driver_block_hotkey(normal_bind, autoconf_bind) |
#define | ISPRINT(c) (((int)(c) >= ' ' && (int)(c) <= '~') ? 1 : 0) |
Typedefs | |
typedef struct turbo_buttons | turbo_buttons_t |
#define check_input_driver_block_hotkey | ( | normal_bind, | |
autoconf_bind | |||
) |
check_input_driver_block_hotkey:
Checks if 'hotkey enable' key is pressed.
If we haven't bound anything to this, always allow hotkeys.
If we hold ENABLE_HOTKEY button, block all libretro input to allow hotkeys to be bound to same keys as RetroPad.
typedef struct turbo_buttons turbo_buttons_t |
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 '|'.
void fire_connection_listener | ( | unsigned | port, |
input_device_driver_t * | driver | ||
) |
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.
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.
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.
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 * | drv, |
unsigned | port, | ||
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.
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).
|
static |
input_keyboard_line_event: : Input keyboard line handle. : Inputted character.
Called on every keyboard character event.
Returns: true (1) on success, otherwise false (0).
const char** input_keyboard_start_line | ( | void * | userdata, |
input_keyboard_line_complete_t | cb | ||
) |
input_keyboard_start_line: : Userdata. : Line complete callback function.
Sets function pointer for keyboard line handle.
The underlying buffer can be reallocated at any time (or be NULL), but the pointer to it remains constant throughout the objects lifetime.
Returns: underlying buffer of the keyboard line.
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.
|
static |
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.
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.
void set_connection_listener | ( | pad_connection_listener_t * | listener | ) |
state_tracker_update_input:
Updates 16-bit input in same format as libretro API itself.
|
static |
|
static |
|
static |
struct retro_keybind input_autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END] |
const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] |
struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END] |
|
static |
|
static |
char input_device_names[MAX_INPUT_DEVICES][64] |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const struct retro_keybind* libretro_input_binds[MAX_USERS] |
uint64_t lifecycle_state |
|
static |
|
static |
|
static |