comparison io.c @ 1576:2b132d894d76

Release capture of mouse and keyboard when entering UI
author Michael Pavone <pavone@retrodev.com>
date Tue, 01 May 2018 09:44:44 -0700
parents 577253765192
children 430dd12e4010
comparison
equal deleted inserted replaced
1575:ccb3a8ae7ad0 1576:2b132d894d76
669 mice[mouse].motion_port->device.mouse.cur_x += deltax; 669 mice[mouse].motion_port->device.mouse.cur_x += deltax;
670 mice[mouse].motion_port->device.mouse.cur_y += deltay; 670 mice[mouse].motion_port->device.mouse.cur_y += deltay;
671 } 671 }
672 break; 672 break;
673 } 673 }
674 }
675 }
676
677 void io_release_capture(sega_io *io)
678 {
679 if (io->mouse_mode == MOUSE_RELATIVE || (io->mouse_mode == MOUSE_CAPTURE && io->mouse_captured)) {
680 render_relative_mouse(0);
681 }
682 current_io->keyboard_captured = 0;
683 }
684
685 void io_reacquire_capture(sega_io *io)
686 {
687 if (io->mouse_mode == MOUSE_RELATIVE || (io->mouse_mode == MOUSE_CAPTURE && io->mouse_captured)) {
688 render_relative_mouse(1);
674 } 689 }
675 } 690 }
676 691
677 int parse_binding_target(char * target, tern_node * padbuttons, tern_node *mousebuttons, int * ui_out, int * padnum_out, int * padbutton_out) 692 int parse_binding_target(char * target, tern_node * padbuttons, tern_node *mousebuttons, int * ui_out, int * padnum_out, int * padbutton_out)
678 { 693 {