diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-05-01 09:44:44 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-05-01 09:44:44 -0700 |
commit | 402a4dd637fd6cee7a1b76ca8ac895659b400032 (patch) | |
tree | 4e0f534facd338ae2246d003dd7f773b8bf21183 /io.c | |
parent | e3ce641cfe3b52dc373e79b6c160167569f1259e (diff) |
Release capture of mouse and keyboard when entering UI
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -674,6 +674,21 @@ void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16 } } +void io_release_capture(sega_io *io) +{ + if (io->mouse_mode == MOUSE_RELATIVE || (io->mouse_mode == MOUSE_CAPTURE && io->mouse_captured)) { + render_relative_mouse(0); + } + current_io->keyboard_captured = 0; +} + +void io_reacquire_capture(sega_io *io) +{ + if (io->mouse_mode == MOUSE_RELATIVE || (io->mouse_mode == MOUSE_CAPTURE && io->mouse_captured)) { + render_relative_mouse(1); + } +} + int parse_binding_target(char * target, tern_node * padbuttons, tern_node *mousebuttons, int * ui_out, int * padnum_out, int * padbutton_out) { const int gpadslen = strlen("gamepads."); |