Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Macros | Functions | Variables
emutools_hid.c File Reference
#include "xemu/emutools.h"
#include "xemu/emutools_hid.h"
Include dependency graph for emutools_hid.c:

Go to the source code of this file.

Macros

#define MAX_JOYSTICKS   16
 
#define JOYSTATE_UP   1
 
#define JOYSTATE_DOWN   2
 
#define JOYSTATE_LEFT   4
 
#define JOYSTATE_RIGHT   8
 
#define JOYSTATE_BUTTON   16
 
#define MOUSESTATE_BUTTON_LEFT   32
 
#define MOUSESTATE_BUTTON_RIGHT   64
 
#define HID_MAX_CUSTOM_CALLBACKS   3
 
#define TRY_CUSTOM_CALLBACKS(cbs, par)
 

Functions

void hid_set_autoreleased_key (int key)
 
int hid_key_event (SDL_Scancode key, int pressed)
 
void hid_sdl_synth_key_event (int matrix_pos, int is_press)
 
void hid_reset_events (int burn)
 
void hid_init (const struct KeyMappingDefault *key_map_in, Uint8 virtual_shift_pos_in, int joy_enable)
 
void hid_mouse_motion_event (int xrel, int yrel)
 
void hid_mouse_button_event (int button, int pressed)
 
void hid_joystick_device_event (int which, int is_attach)
 
void hid_joystick_motion_event (int is_vertical, int value)
 
void hid_joystick_button_event (int pressed)
 
void hid_joystick_hat_event (int value)
 
int hid_read_joystick_up (int on, int off)
 
int hid_read_joystick_down (int on, int off)
 
int hid_read_joystick_left (int on, int off)
 
int hid_read_joystick_right (int on, int off)
 
int hid_read_joystick_button (int on, int off)
 
int hid_read_mouse_rel_x (int min, int max)
 
int hid_read_mouse_rel_y (int min, int max)
 
int hid_read_mouse_button_left (int on, int off)
 
int hid_read_mouse_button_right (int on, int off)
 
int hid_handle_one_sdl_event (SDL_Event *event)
 
void hid_handle_all_sdl_events (void)
 
void hid_register_sdl_keyboard_event_callback (const unsigned int level, hid_sdl_keyboard_event_callback_t cb)
 
void hid_register_sdl_textediting_event_callback (const unsigned int level, hid_sdl_textediting_event_callback_t cb)
 
void hid_register_sdl_textinput_event_callback (const unsigned int level, hid_sdl_textinput_event_callback_t cb)
 

Variables

Uint8 kbd_matrix [16]
 
int hid_show_osd_keys = 0
 
int hid_joy_on_cursor_keys = 0
 

Macro Definition Documentation

◆ HID_MAX_CUSTOM_CALLBACKS

#define HID_MAX_CUSTOM_CALLBACKS   3

Definition at line 60 of file emutools_hid.c.

◆ JOYSTATE_BUTTON

#define JOYSTATE_BUTTON   16

Definition at line 49 of file emutools_hid.c.

◆ JOYSTATE_DOWN

#define JOYSTATE_DOWN   2

Definition at line 46 of file emutools_hid.c.

◆ JOYSTATE_LEFT

#define JOYSTATE_LEFT   4

Definition at line 47 of file emutools_hid.c.

◆ JOYSTATE_RIGHT

#define JOYSTATE_RIGHT   8

Definition at line 48 of file emutools_hid.c.

◆ JOYSTATE_UP

#define JOYSTATE_UP   1

Definition at line 45 of file emutools_hid.c.

◆ MAX_JOYSTICKS

#define MAX_JOYSTICKS   16

Definition at line 41 of file emutools_hid.c.

◆ MOUSESTATE_BUTTON_LEFT

#define MOUSESTATE_BUTTON_LEFT   32

Definition at line 50 of file emutools_hid.c.

◆ MOUSESTATE_BUTTON_RIGHT

#define MOUSESTATE_BUTTON_RIGHT   64

Definition at line 51 of file emutools_hid.c.

◆ TRY_CUSTOM_CALLBACKS

#define TRY_CUSTOM_CALLBACKS (   cbs,
  par 
)
Value:
do { \
for (int i = 0; i < HID_MAX_CUSTOM_CALLBACKS; i++) \
if (cbs[i] && !cbs[i](par)) \
goto give_up; \
} while(0)

Definition at line 521 of file emutools_hid.c.

Function Documentation

◆ hid_handle_all_sdl_events()

void hid_handle_all_sdl_events ( void  )

Definition at line 613 of file emutools_hid.c.

Here is the call graph for this function:

◆ hid_handle_one_sdl_event()

int hid_handle_one_sdl_event ( SDL_Event *  event)

Definition at line 528 of file emutools_hid.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hid_init()

void hid_init ( const struct KeyMappingDefault key_map_in,
Uint8  virtual_shift_pos_in,
int  joy_enable 
)

Definition at line 300 of file emutools_hid.c.

◆ hid_joystick_button_event()

void hid_joystick_button_event ( int  pressed)

Definition at line 432 of file emutools_hid.c.

◆ hid_joystick_device_event()

void hid_joystick_device_event ( int  which,
int  is_attach 
)

Definition at line 390 of file emutools_hid.c.

◆ hid_joystick_hat_event()

void hid_joystick_hat_event ( int  value)

Definition at line 441 of file emutools_hid.c.

◆ hid_joystick_motion_event()

void hid_joystick_motion_event ( int  is_vertical,
int  value 
)

Definition at line 414 of file emutools_hid.c.

◆ hid_key_event()

int hid_key_event ( SDL_Scancode  key,
int  pressed 
)

Definition at line 72 of file emutools_hid.c.

◆ hid_mouse_button_event()

void hid_mouse_button_event ( int  button,
int  pressed 
)

Definition at line 374 of file emutools_hid.c.

◆ hid_mouse_motion_event()

void hid_mouse_motion_event ( int  xrel,
int  yrel 
)

Definition at line 366 of file emutools_hid.c.

◆ hid_read_joystick_button()

int hid_read_joystick_button ( int  on,
int  off 
)

Definition at line 479 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_joystick_down()

int hid_read_joystick_down ( int  on,
int  off 
)

Definition at line 461 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_joystick_left()

int hid_read_joystick_left ( int  on,
int  off 
)

Definition at line 467 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_joystick_right()

int hid_read_joystick_right ( int  on,
int  off 
)

Definition at line 473 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_joystick_up()

int hid_read_joystick_up ( int  on,
int  off 
)

Definition at line 455 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_mouse_button_left()

int hid_read_mouse_button_left ( int  on,
int  off 
)

Definition at line 509 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_mouse_button_right()

int hid_read_mouse_button_right ( int  on,
int  off 
)

Definition at line 515 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_read_mouse_rel_x()

int hid_read_mouse_rel_x ( int  min,
int  max 
)

Definition at line 485 of file emutools_hid.c.

◆ hid_read_mouse_rel_y()

int hid_read_mouse_rel_y ( int  min,
int  max 
)

Definition at line 497 of file emutools_hid.c.

◆ hid_register_sdl_keyboard_event_callback()

void hid_register_sdl_keyboard_event_callback ( const unsigned int  level,
hid_sdl_keyboard_event_callback_t  cb 
)

Definition at line 621 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_register_sdl_textediting_event_callback()

void hid_register_sdl_textediting_event_callback ( const unsigned int  level,
hid_sdl_textediting_event_callback_t  cb 
)

Definition at line 626 of file emutools_hid.c.

◆ hid_register_sdl_textinput_event_callback()

void hid_register_sdl_textinput_event_callback ( const unsigned int  level,
hid_sdl_textinput_event_callback_t  cb 
)

Definition at line 631 of file emutools_hid.c.

◆ hid_reset_events()

void hid_reset_events ( int  burn)

Definition at line 170 of file emutools_hid.c.

Here is the caller graph for this function:

◆ hid_sdl_synth_key_event()

void hid_sdl_synth_key_event ( int  matrix_pos,
int  is_press 
)

Definition at line 145 of file emutools_hid.c.

◆ hid_set_autoreleased_key()

void hid_set_autoreleased_key ( int  key)

Definition at line 66 of file emutools_hid.c.

Variable Documentation

◆ hid_joy_on_cursor_keys

int hid_joy_on_cursor_keys = 0

Definition at line 35 of file emutools_hid.c.

◆ hid_show_osd_keys

int hid_show_osd_keys = 0

Definition at line 34 of file emutools_hid.c.

◆ kbd_matrix

Uint8 kbd_matrix[16]

Definition at line 33 of file emutools_hid.c.

HID_MAX_CUSTOM_CALLBACKS
#define HID_MAX_CUSTOM_CALLBACKS
Definition: emutools_hid.c:60