mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Dynamic handling of guest mice, by Lonnie Mendez.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2290 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
6f30fa853b
commit
455204eb1a
9 changed files with 176 additions and 19 deletions
7
sdl.c
7
sdl.c
|
@ -319,6 +319,7 @@ static void sdl_show_cursor(void)
|
|||
{
|
||||
if (!kbd_mouse_is_absolute()) {
|
||||
SDL_ShowCursor(1);
|
||||
SDL_SetCursor(sdl_cursor_normal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -364,6 +365,9 @@ static void sdl_send_mouse_event(int dz)
|
|||
SDL_GetMouseState(&dx, &dy);
|
||||
dx = dx * 0x7FFF / width;
|
||||
dy = dy * 0x7FFF / height;
|
||||
} else if (absolute_enabled) {
|
||||
sdl_show_cursor();
|
||||
absolute_enabled = 0;
|
||||
}
|
||||
|
||||
kbd_mouse_event(dx, dy, dz, buttons);
|
||||
|
@ -501,7 +505,8 @@ static void sdl_refresh(DisplayState *ds)
|
|||
}
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
if (gui_grab || kbd_mouse_is_absolute()) {
|
||||
if (gui_grab || kbd_mouse_is_absolute() ||
|
||||
absolute_enabled) {
|
||||
sdl_send_mouse_event(0);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue