Skip to content

Commit

Permalink
sdl2: turn on keyboard grabs
Browse files Browse the repository at this point in the history
Makes quite some keys actually go to the guest instead of
being captured by the host window manager.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
  • Loading branch information
kraxel committed Dec 17, 2014
1 parent 8fc1a3f commit 44f017d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ static void sdl_update_caption(struct sdl2_console *scon)
status = " [Stopped]";
} else if (gui_grab) {
if (alt_grab) {
status = " - Press Ctrl-Alt-Shift to exit mouse grab";
status = " - Press Ctrl-Alt-Shift to exit grab";
} else if (ctrl_grab) {
status = " - Press Right-Ctrl to exit mouse grab";
status = " - Press Right-Ctrl to exit grab";
} else {
status = " - Press Ctrl-Alt to exit mouse grab";
status = " - Press Ctrl-Alt to exit grab";
}
}

Expand Down Expand Up @@ -785,6 +785,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
SDL_GetError());
exit(1);
}
SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");

for (i = 0;; i++) {
QemuConsole *con = qemu_console_lookup_by_index(i);
Expand Down

0 comments on commit 44f017d

Please sign in to comment.