diff options
Diffstat (limited to 'sdl.c')
-rw-r--r-- | sdl.c | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -223,8 +223,12 @@ static void sdl_update_caption(void) if (!vm_running) status = " [Stopped]"; - else if (gui_grab) - status = " - Press Ctrl-Alt to exit grab"; + else if (gui_grab) { + if (!alt_grab) + status = " - Press Ctrl-Alt to exit grab"; + else + status = " - Press Ctrl-Alt-Shift to exit grab"; + } if (qemu_name) snprintf(buf, sizeof(buf), "QEMU (%s)%s", qemu_name, status); @@ -357,8 +361,13 @@ static void sdl_refresh(DisplayState *ds) case SDL_KEYDOWN: case SDL_KEYUP: if (ev->type == SDL_KEYDOWN) { - mod_state = (SDL_GetModState() & gui_grab_code) == - gui_grab_code; + if (!alt_grab) { + mod_state = (SDL_GetModState() & gui_grab_code) == + gui_grab_code; + } else { + mod_state = (SDL_GetModState() & (gui_grab_code | KMOD_LSHIFT)) == + (gui_grab_code | KMOD_LSHIFT); + } gui_key_modifier_pressed = mod_state; if (gui_key_modifier_pressed) { int keycode; @@ -419,7 +428,12 @@ static void sdl_refresh(DisplayState *ds) } } } else if (ev->type == SDL_KEYUP) { - mod_state = (ev->key.keysym.mod & gui_grab_code); + if (!alt_grab) { + mod_state = (ev->key.keysym.mod & gui_grab_code); + } else { + mod_state = (ev->key.keysym.mod & + (gui_grab_code | KMOD_LSHIFT)); + } if (!mod_state) { if (gui_key_modifier_pressed) { gui_key_modifier_pressed = 0; |