diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-06-21 21:08:02 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-06-21 21:08:02 +0000 |
commit | 3780e197e4e32f0e6341bdc9a1943d0842b48ec6 (patch) | |
tree | 21626ae2581730a7a8539b27e8a8dd0e6e8de3dc /sdl.c | |
parent | 731345e17b8a34f88eeb75c582f19e9790e7d834 (diff) | |
download | qemu-3780e197e4e32f0e6341bdc9a1943d0842b48ec6.zip qemu-3780e197e4e32f0e6341bdc9a1943d0842b48ec6.tar.gz qemu-3780e197e4e32f0e6341bdc9a1943d0842b48ec6.tar.bz2 |
Add alternate grab key, by Michael Mohr.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2990 c046a42c-6fe2-441c-8c8c-71466251a162
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; |