From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNF6k-0008Jx-Rz for qemu-devel@nongnu.org; Thu, 07 Feb 2008 17:20:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNF6h-0008HC-Ox for qemu-devel@nongnu.org; Thu, 07 Feb 2008 17:20:38 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNF6h-0008H5-Mb for qemu-devel@nongnu.org; Thu, 07 Feb 2008 17:20:35 -0500 Received: from mailgate.cs.fh-nuernberg.de ([141.75.25.50]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNF6h-0004DT-37 for qemu-devel@nongnu.org; Thu, 07 Feb 2008 17:20:35 -0500 Received: from stud-iss.cs.fh-nuernberg.de (stud-iss.cs.fh-nuernberg.de [141.75.25.30]) by mailgate.cs.fh-nuernberg.de with ESMTP id BT-MMP-177052 for qemu-devel@nongnu.org; Thu, 7 Feb 2008 23:20:30 +0100 Received: from [192.168.1.20] ([91.8.149.11] [91.8.149.11]) by stud-iss.cs.fh-nuernberg.de with ESMTP for qemu-devel@nongnu.org; Thu, 7 Feb 2008 23:20:21 +0100 Message-Id: <47AB8413.2020300@student.fh-nuernberg.de> Date: Thu, 7 Feb 2008 23:20:03 +0100 From: =?ISO-8859-15?Q?Tobias_Glei=DFner?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080402030406070107020601" Sender: Tobias.Gleissner@student.fh-nuernberg.de Subject: [Qemu-devel] [PATCH] Change the behaviour of -alt-grab and add X11-shortcuts Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080402030406070107020601 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hello, this patch to sdl.c (qemu 0.9.1) changes the behavior of -alt-grab to be similar to VirtualBox. The reason for this is to have an easy way for sending ctrl-alt-Fn and ctrl-alt-backspace to the guest. Since ctrl-alt-Fn and ctrl-alt-backspace are intercepted by X11 new shortcuts are added: + + For this to work the alternative grab key is changed from ++ to . When a ctrl-key is needed, the left ctrl-key can still be used (this also applies to combinations like ctrl-alt-delete for which the -alt-grab option was originally added). Disclaimer: I'm not very familiar with the qemu sources and perhaps there is a nicer way for sending the keys to the guest. --------------080402030406070107020601 Content-Type: text/x-diff; name="alt-grab.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="alt-grab.patch" --- qemu/sdl.c 2008-01-06 20:38:42.000000000 +0100 +++ qemu-altgrabmod/sdl.c 2008-02-07 20:04:58.000000000 +0100 @@ -229,7 +229,7 @@ if (!alt_grab) status = " - Press Ctrl-Alt to exit grab"; else - status = " - Press Ctrl-Alt-Shift to exit grab"; + status = " - Press Ctrl (right) to exit grab"; } if (qemu_name) @@ -367,8 +367,8 @@ 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); + mod_state = (SDL_GetModState() & KMOD_RCTRL) == + KMOD_RCTRL; } gui_key_modifier_pressed = mod_state; if (gui_key_modifier_pressed) { @@ -390,6 +390,19 @@ } gui_keysym = 1; break; + case 0x3b ... 0x44: /* F1 .. F10 keys */ + case 0xe: /* backspace */ + /* like sendkey ctrl-alt-(fn|backspace) */ + /* key down */ + kbd_put_keycode(0x1d); /* left ctrl key */ + kbd_put_keycode(0x38); /* left alt key */ + kbd_put_keycode(keycode); + /* key up */ + kbd_put_keycode(0x1d|0x80); + kbd_put_keycode(0x38|0x80); + kbd_put_keycode(keycode|0x80); + gui_keysym = 1; + break; default: break; } --------------080402030406070107020601--