Mercurial > repos > blastem
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bindings.h Sat May 05 23:30:40 2018 -0700 @@ -0,0 +1,28 @@ +#ifndef BINDINGS_H_ +#define BINDINGS_H_ +#include <stdint.h> + +typedef enum { + MOUSE_NONE, //mouse is ignored + MOUSE_ABSOLUTE, //really only useful for menu ROM + MOUSE_RELATIVE, //for full screen + MOUSE_CAPTURE //for windowed mode +} mouse_modes; + +void set_bindings(void); +void bindings_set_mouse_mode(uint8_t mode); +void handle_keydown(int keycode, uint8_t scancode); +void handle_keyup(int keycode, uint8_t scancode); +void handle_joydown(int joystick, int button); +void handle_joyup(int joystick, int button); +void handle_joy_dpad(int joystick, int dpad, uint8_t state); +void handle_joy_axis(int joystick, int axis, int16_t value); +void handle_joy_added(int joystick); +void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay); +void handle_mousedown(int mouse, int button); +void handle_mouseup(int mouse, int button); + +void bindings_release_capture(void); +void bindings_reacquire_capture(void); + +#endif //BINDINGS_H_