summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-21 21:08:02 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-21 21:08:02 +0000
commit3780e197e4e32f0e6341bdc9a1943d0842b48ec6 (patch)
tree21626ae2581730a7a8539b27e8a8dd0e6e8de3dc /sdl.c
parent731345e17b8a34f88eeb75c582f19e9790e7d834 (diff)
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.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/sdl.c b/sdl.c
index 5e70ac08b3..16e4df6332 100644
--- a/sdl.c
+++ b/sdl.c
@@ -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;