RetroArch
Classes | Macros | Typedefs | Functions | Variables
rwebinput_input.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <boolean.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <encodings/crc32.h>
#include <encodings/utf.h>
#include <emscripten/html5.h>
#include "../input_driver.h"
#include "../input_keymaps.h"
#include "../../tasks/tasks_internal.h"
#include "../../configuration.h"
#include "../../verbosity.h"
Include dependency graph for rwebinput_input.c:

Classes

struct  rwebinput_key_to_code_map_entry
 
struct  rwebinput_keyboard_event
 
struct  rwebinput_keyboard_event_queue
 
struct  rwebinput_mouse_states
 
struct  rwebinput_input
 

Macros

#define RWEBINPUT_MOUSE_BTNL   0
 
#define RWEBINPUT_MOUSE_BTNM   1
 
#define RWEBINPUT_MOUSE_BTNR   2
 
#define RWEBINPUT_MOUSE_BTN4   3
 
#define RWEBINPUT_MOUSE_BTN5   4
 

Typedefs

typedef struct rwebinput_key_to_code_map_entry rwebinput_key_to_code_map_entry_t
 
typedef struct rwebinput_keyboard_event rwebinput_keyboard_event_t
 
typedef struct rwebinput_keyboard_event_queue rwebinput_keyboard_event_queue_t
 
typedef struct rwebinput_mouse_states rwebinput_mouse_state_t
 
typedef struct rwebinput_input rwebinput_input_t
 

Functions

static void rwebinput_generate_lut (void)
 
static EM_BOOL rwebinput_keyboard_cb (int event_type, const EmscriptenKeyboardEvent *key_event, void *user_data)
 
static EM_BOOL rwebinput_mouse_cb (int event_type, const EmscriptenMouseEvent *mouse_event, void *user_data)
 
static EM_BOOL rwebinput_wheel_cb (int event_type, const EmscriptenWheelEvent *wheel_event, void *user_data)
 
static voidrwebinput_input_init (const char *joypad_driver)
 
static bool rwebinput_key_pressed (rwebinput_input_t *rwebinput, int key)
 
static int16_t rwebinput_pointer_device_state (rwebinput_mouse_state_t *mouse, unsigned id, bool screen)
 
static int16_t rwebinput_mouse_state (rwebinput_mouse_state_t *mouse, unsigned id, bool screen)
 
static bool rwebinput_is_pressed (rwebinput_input_t *rwebinput, rarch_joypad_info_t joypad_info, const struct retro_keybind *binds, unsigned port, unsigned id)
 
static int16_t rwebinput_analog_pressed (rwebinput_input_t *rwebinput, rarch_joypad_info_t joypad_info, const struct retro_keybind *binds, unsigned idx, unsigned id)
 
static int16_t rwebinput_input_state (void *data, rarch_joypad_info_t joypad_info, const struct retro_keybind **binds, unsigned port, unsigned device, unsigned idx, unsigned id)
 
static void rwebinput_input_free (void *data)
 
static void rwebinput_process_keyboard_events (rwebinput_input_t *rwebinput, rwebinput_keyboard_event_t *event)
 
static void rwebinput_input_poll (void *data)
 
static void rwebinput_grab_mouse (void *data, bool state)
 
static bool rwebinput_set_rumble (void *data, unsigned port, enum retro_rumble_effect effect, uint16_t strength)
 
static const input_device_driver_trwebinput_get_joypad_driver (void *data)
 
static uint64_t rwebinput_get_capabilities (void *data)
 
static bool rwebinput_keyboard_mapping_is_blocked (void *data)
 
static void rwebinput_keyboard_mapping_set_block (void *data, bool value)
 

Variables

static const rwebinput_key_to_code_map_entry_t rwebinput_key_to_code_map []
 
static bool g_rwebinput_initialized
 
static rwebinput_keyboard_event_queue_tg_rwebinput_keyboard
 
static rwebinput_mouse_state_tg_rwebinput_mouse
 
input_driver_t input_rwebinput
 

Macro Definition Documentation

◆ RWEBINPUT_MOUSE_BTN4

#define RWEBINPUT_MOUSE_BTN4   3

◆ RWEBINPUT_MOUSE_BTN5

#define RWEBINPUT_MOUSE_BTN5   4

◆ RWEBINPUT_MOUSE_BTNL

#define RWEBINPUT_MOUSE_BTNL   0

◆ RWEBINPUT_MOUSE_BTNM

#define RWEBINPUT_MOUSE_BTNM   1

◆ RWEBINPUT_MOUSE_BTNR

#define RWEBINPUT_MOUSE_BTNR   2

Typedef Documentation

◆ rwebinput_input_t

◆ rwebinput_key_to_code_map_entry_t

◆ rwebinput_keyboard_event_queue_t

◆ rwebinput_keyboard_event_t

◆ rwebinput_mouse_state_t

Function Documentation

◆ rwebinput_analog_pressed()

static int16_t rwebinput_analog_pressed ( rwebinput_input_t rwebinput,
rarch_joypad_info_t  joypad_info,
const struct retro_keybind binds,
unsigned  idx,
unsigned  id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwebinput_generate_lut()

static void rwebinput_generate_lut ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwebinput_get_capabilities()

static uint64_t rwebinput_get_capabilities ( void data)
static

◆ rwebinput_get_joypad_driver()

static const input_device_driver_t* rwebinput_get_joypad_driver ( void data)
static

◆ rwebinput_grab_mouse()

static void rwebinput_grab_mouse ( void data,
bool  state 
)
static
Here is the call graph for this function:

◆ rwebinput_input_free()

static void rwebinput_input_free ( void data)
static
Here is the call graph for this function:

◆ rwebinput_input_init()

static void* rwebinput_input_init ( const char *  joypad_driver)
static
Here is the call graph for this function:

◆ rwebinput_input_poll()

static void rwebinput_input_poll ( void data)
static
Here is the call graph for this function:

◆ rwebinput_input_state()

static int16_t rwebinput_input_state ( void data,
rarch_joypad_info_t  joypad_info,
const struct retro_keybind **  binds,
unsigned  port,
unsigned  device,
unsigned  idx,
unsigned  id 
)
static
Here is the call graph for this function:

◆ rwebinput_is_pressed()

static bool rwebinput_is_pressed ( rwebinput_input_t rwebinput,
rarch_joypad_info_t  joypad_info,
const struct retro_keybind binds,
unsigned  port,
unsigned  id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwebinput_key_pressed()

static bool rwebinput_key_pressed ( rwebinput_input_t rwebinput,
int  key 
)
static
Here is the caller graph for this function:

◆ rwebinput_keyboard_cb()

static EM_BOOL rwebinput_keyboard_cb ( int  event_type,
const EmscriptenKeyboardEvent *  key_event,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwebinput_keyboard_mapping_is_blocked()

static bool rwebinput_keyboard_mapping_is_blocked ( void data)
static

◆ rwebinput_keyboard_mapping_set_block()

static void rwebinput_keyboard_mapping_set_block ( void data,
bool  value 
)
static

◆ rwebinput_mouse_cb()

static EM_BOOL rwebinput_mouse_cb ( int  event_type,
const EmscriptenMouseEvent *  mouse_event,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwebinput_mouse_state()

static int16_t rwebinput_mouse_state ( rwebinput_mouse_state_t mouse,
unsigned  id,
bool  screen 
)
static
Here is the caller graph for this function:

◆ rwebinput_pointer_device_state()

static int16_t rwebinput_pointer_device_state ( rwebinput_mouse_state_t mouse,
unsigned  id,
bool  screen 
)
static
Here is the caller graph for this function:

◆ rwebinput_process_keyboard_events()

static void rwebinput_process_keyboard_events ( rwebinput_input_t rwebinput,
rwebinput_keyboard_event_t event 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwebinput_set_rumble()

static bool rwebinput_set_rumble ( void data,
unsigned  port,
enum retro_rumble_effect  effect,
uint16_t  strength 
)
static
Here is the call graph for this function:

◆ rwebinput_wheel_cb()

static EM_BOOL rwebinput_wheel_cb ( int  event_type,
const EmscriptenWheelEvent *  wheel_event,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_rwebinput_initialized

bool g_rwebinput_initialized
static

◆ g_rwebinput_keyboard

rwebinput_keyboard_event_queue_t* g_rwebinput_keyboard
static

◆ g_rwebinput_mouse

rwebinput_mouse_state_t* g_rwebinput_mouse
static

◆ input_rwebinput

input_driver_t input_rwebinput
Initial value:
= {
"rwebinput",
}
static void rwebinput_keyboard_mapping_set_block(void *data, bool value)
Definition: rwebinput_input.c:682
static bool rwebinput_set_rumble(void *data, unsigned port, enum retro_rumble_effect effect, uint16_t strength)
Definition: rwebinput_input.c:642
static uint64_t rwebinput_get_capabilities(void *data)
Definition: rwebinput_input.c:661
static void * rwebinput_input_init(const char *joypad_driver)
Definition: rwebinput_input.c:297
static void rwebinput_input_free(void *data)
Definition: rwebinput_input.c:555
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int16_t rwebinput_input_state(void *data, rarch_joypad_info_t joypad_info, const struct retro_keybind **binds, unsigned port, unsigned device, unsigned idx, unsigned id)
Definition: rwebinput_input.c:518
static void rwebinput_grab_mouse(void *data, bool state)
Definition: rwebinput_input.c:632
static void rwebinput_input_poll(void *data)
Definition: rwebinput_input.c:614
static bool rwebinput_keyboard_mapping_is_blocked(void *data)
Definition: rwebinput_input.c:674
static const input_device_driver_t * rwebinput_get_joypad_driver(void *data)
Definition: rwebinput_input.c:653

◆ rwebinput_key_to_code_map

const rwebinput_key_to_code_map_entry_t rwebinput_key_to_code_map[]
static