Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Data Structures | Macros | Typedefs | Functions | Variables
emutools_hid.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  KeyMappingDefault
 
struct  KeyMappingUsed
 

Macros

#define KBD_CLEAR_MATRIX()   memset(kbd_matrix, 0xFF, sizeof kbd_matrix)
 
#define KBD_PRESS_KEY(a)   kbd_matrix[(a) >> 4] &= ~(1 << ((a) & 0x7))
 
#define KBD_RELEASE_KEY(a)   kbd_matrix[(a) >> 4] |= 1 << ((a) & 0x7)
 
#define KBD_SET_KEY(a, state)
 
#define HID_CB_LEVEL_CORE   0
 
#define HID_CB_LEVEL_CONSOLE   1
 
#define HID_CB_LEVEL_EMU   2
 
#define XEMU_EVENT_EXIT   0x100
 
#define XEMU_EVENT_FAKE_JOY_UP   0x101
 
#define XEMU_EVENT_FAKE_JOY_DOWN   0x102
 
#define XEMU_EVENT_FAKE_JOY_LEFT   0x103
 
#define XEMU_EVENT_FAKE_JOY_RIGHT   0x104
 
#define XEMU_EVENT_FAKE_JOY_FIRE   0x105
 
#define XEMU_EVENT_TOGGLE_FULLSCREEN   0x106
 
#define STD_XEMU_SPECIAL_KEYS
 

Typedefs

typedef int(* hid_sdl_keyboard_event_callback_t) (SDL_KeyboardEvent *)
 
typedef int(* hid_sdl_textediting_event_callback_t) (SDL_TextEditingEvent *)
 
typedef int(* hid_sdl_textinput_event_callback_t) (SDL_TextInputEvent *)
 

Functions

int emu_callback_key (int pos, SDL_Scancode key, int pressed, int handled)
 
void emu_dropfile_callback (const char *fn)
 
void emu_quit_callback (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)
 
void hid_sdl_synth_key_event (int matrix_pos, int is_press)
 
void hid_set_autoreleased_key (int key)
 
int hid_key_event (SDL_Scancode key, int pressed)
 
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_button_left (int on, int off)
 
int hid_read_mouse_button_right (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_handle_one_sdl_event (SDL_Event *event)
 
void hid_handle_all_sdl_events (void)
 

Variables

Uint8 kbd_matrix [16]
 
int hid_show_osd_keys
 
int hid_joy_on_cursor_keys
 
int hid_mouse_enabled
 

Macro Definition Documentation

◆ HID_CB_LEVEL_CONSOLE

#define HID_CB_LEVEL_CONSOLE   1

Definition at line 72 of file emutools_hid.h.

◆ HID_CB_LEVEL_CORE

#define HID_CB_LEVEL_CORE   0

Definition at line 71 of file emutools_hid.h.

◆ HID_CB_LEVEL_EMU

#define HID_CB_LEVEL_EMU   2

Definition at line 73 of file emutools_hid.h.

◆ KBD_CLEAR_MATRIX

#define KBD_CLEAR_MATRIX ( )    memset(kbd_matrix, 0xFF, sizeof kbd_matrix)

Definition at line 45 of file emutools_hid.h.

◆ KBD_PRESS_KEY

#define KBD_PRESS_KEY (   a)    kbd_matrix[(a) >> 4] &= ~(1 << ((a) & 0x7))

Definition at line 46 of file emutools_hid.h.

◆ KBD_RELEASE_KEY

#define KBD_RELEASE_KEY (   a)    kbd_matrix[(a) >> 4] |= 1 << ((a) & 0x7)

Definition at line 47 of file emutools_hid.h.

◆ KBD_SET_KEY

#define KBD_SET_KEY (   a,
  state 
)
Value:
do { \
if (state) \
KBD_PRESS_KEY(a); \
} while (0)

Definition at line 48 of file emutools_hid.h.

◆ STD_XEMU_SPECIAL_KEYS

#define STD_XEMU_SPECIAL_KEYS
Value:
{ SDL_SCANCODE_F9, XEMU_EVENT_EXIT, "XEMU-EXIT" }, \
{ SDL_SCANCODE_F11, XEMU_EVENT_TOGGLE_FULLSCREEN, "XEMU-FULLSCREEN" }, \
{ SDL_SCANCODE_KP_5, XEMU_EVENT_FAKE_JOY_FIRE, "XEMU-JOY-FIRE" }, /* for joy FIRE we map PC num keypad 5 */ \
{ SDL_SCANCODE_KP_0, XEMU_EVENT_FAKE_JOY_FIRE, "XEMU-JOY-FIRE" }, /* PC num keypad 0 is also the FIRE ... */ \
{ SDL_SCANCODE_RCTRL, XEMU_EVENT_FAKE_JOY_FIRE, "XEMU-JOY-FIRE" }, /* and RIGHT controll is also the FIRE ... to make Sven happy :) */ \
{ SDL_SCANCODE_KP_8, XEMU_EVENT_FAKE_JOY_UP, "XEMU-JOY-UP" }, /* for joy UP we map PC num keypad 8 */ \
{ SDL_SCANCODE_KP_2, XEMU_EVENT_FAKE_JOY_DOWN, "XEMU-JOY-DOWN" }, /* for joy DOWN we map PC num keypad 2 */ \
{ SDL_SCANCODE_KP_4, XEMU_EVENT_FAKE_JOY_LEFT, "XEMU-JOY-LEFT" }, /* for joy LEFT we map PC num keypad 4 */ \
{ SDL_SCANCODE_KP_6, XEMU_EVENT_FAKE_JOY_RIGHT, "XEMU-JOY-RIGHT" } /* for joy RIGHT we map PC num keypad 6 */

Definition at line 108 of file emutools_hid.h.

◆ XEMU_EVENT_EXIT

#define XEMU_EVENT_EXIT   0x100

Definition at line 100 of file emutools_hid.h.

◆ XEMU_EVENT_FAKE_JOY_DOWN

#define XEMU_EVENT_FAKE_JOY_DOWN   0x102

Definition at line 102 of file emutools_hid.h.

◆ XEMU_EVENT_FAKE_JOY_FIRE

#define XEMU_EVENT_FAKE_JOY_FIRE   0x105

Definition at line 105 of file emutools_hid.h.

◆ XEMU_EVENT_FAKE_JOY_LEFT

#define XEMU_EVENT_FAKE_JOY_LEFT   0x103

Definition at line 103 of file emutools_hid.h.

◆ XEMU_EVENT_FAKE_JOY_RIGHT

#define XEMU_EVENT_FAKE_JOY_RIGHT   0x104

Definition at line 104 of file emutools_hid.h.

◆ XEMU_EVENT_FAKE_JOY_UP

#define XEMU_EVENT_FAKE_JOY_UP   0x101

Definition at line 101 of file emutools_hid.h.

◆ XEMU_EVENT_TOGGLE_FULLSCREEN

#define XEMU_EVENT_TOGGLE_FULLSCREEN   0x106

Definition at line 106 of file emutools_hid.h.

Typedef Documentation

◆ hid_sdl_keyboard_event_callback_t

typedef int(* hid_sdl_keyboard_event_callback_t) (SDL_KeyboardEvent *)

Definition at line 63 of file emutools_hid.h.

◆ hid_sdl_textediting_event_callback_t

typedef int(* hid_sdl_textediting_event_callback_t) (SDL_TextEditingEvent *)

Definition at line 64 of file emutools_hid.h.

◆ hid_sdl_textinput_event_callback_t

typedef int(* hid_sdl_textinput_event_callback_t) (SDL_TextInputEvent *)

Definition at line 65 of file emutools_hid.h.

Function Documentation

◆ emu_callback_key()

int emu_callback_key ( int  pos,
SDL_Scancode  key,
int  pressed,
int  handled 
)

Definition at line 807 of file commodore_65.c.

Here is the call graph for this function:

◆ emu_dropfile_callback()

void emu_dropfile_callback ( const char *  fn)

Definition at line 675 of file primo.c.

Here is the caller graph for this function:

◆ emu_quit_callback()

void emu_quit_callback ( void  )

Definition at line 483 of file primo.c.

Here is the caller graph for this function:

◆ 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

Definition at line 35 of file emutools_hid.c.

◆ hid_mouse_enabled

int hid_mouse_enabled

◆ hid_show_osd_keys

int hid_show_osd_keys

Definition at line 34 of file emutools_hid.c.

◆ kbd_matrix

Uint8 kbd_matrix[16]

Definition at line 30 of file dave.c.

XEMU_EVENT_FAKE_JOY_LEFT
#define XEMU_EVENT_FAKE_JOY_LEFT
Definition: emutools_hid.h:103
XEMU_EVENT_TOGGLE_FULLSCREEN
#define XEMU_EVENT_TOGGLE_FULLSCREEN
Definition: emutools_hid.h:106
XEMU_EVENT_FAKE_JOY_DOWN
#define XEMU_EVENT_FAKE_JOY_DOWN
Definition: emutools_hid.h:102
XEMU_EVENT_FAKE_JOY_UP
#define XEMU_EVENT_FAKE_JOY_UP
Definition: emutools_hid.h:101
XEMU_EVENT_FAKE_JOY_RIGHT
#define XEMU_EVENT_FAKE_JOY_RIGHT
Definition: emutools_hid.h:104
KBD_RELEASE_KEY
#define KBD_RELEASE_KEY(a)
Definition: emutools_hid.h:47
XEMU_EVENT_EXIT
#define XEMU_EVENT_EXIT
Definition: emutools_hid.h:100
XEMU_EVENT_FAKE_JOY_FIRE
#define XEMU_EVENT_FAKE_JOY_FIRE
Definition: emutools_hid.h:105