comparison bindings.h @ 1583:430dd12e4010

Refactor to split device bindings from IO emulation code
author Michael Pavone <pavone@retrodev.com>
date Sat, 05 May 2018 23:30:40 -0700
parents
children 18a946ec74c8
comparison
equal deleted inserted replaced
1582:a74db49fa6b1 1583:430dd12e4010
1 #ifndef BINDINGS_H_
2 #define BINDINGS_H_
3 #include <stdint.h>
4
5 typedef enum {
6 MOUSE_NONE, //mouse is ignored
7 MOUSE_ABSOLUTE, //really only useful for menu ROM
8 MOUSE_RELATIVE, //for full screen
9 MOUSE_CAPTURE //for windowed mode
10 } mouse_modes;
11
12 void set_bindings(void);
13 void bindings_set_mouse_mode(uint8_t mode);
14 void handle_keydown(int keycode, uint8_t scancode);
15 void handle_keyup(int keycode, uint8_t scancode);
16 void handle_joydown(int joystick, int button);
17 void handle_joyup(int joystick, int button);
18 void handle_joy_dpad(int joystick, int dpad, uint8_t state);
19 void handle_joy_axis(int joystick, int axis, int16_t value);
20 void handle_joy_added(int joystick);
21 void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay);
22 void handle_mousedown(int mouse, int button);
23 void handle_mouseup(int mouse, int button);
24
25 void bindings_release_capture(void);
26 void bindings_reacquire_capture(void);
27
28 #endif //BINDINGS_H_