summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2018-05-01 09:44:44 -0700
committerMichael Pavone <pavone@retrodev.com>2018-05-01 09:44:44 -0700
commit402a4dd637fd6cee7a1b76ca8ac895659b400032 (patch)
tree4e0f534facd338ae2246d003dd7f773b8bf21183 /io.c
parente3ce641cfe3b52dc373e79b6c160167569f1259e (diff)
Release capture of mouse and keyboard when entering UI
Diffstat (limited to 'io.c')
-rw-r--r--io.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/io.c b/io.c
index 76bd8a0..9ad6fb1 100644
--- a/io.c
+++ b/io.c
@@ -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.");