From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af8RO-0003BL-Rh for qemu-devel@nongnu.org; Sun, 13 Mar 2016 12:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1af8RN-0001q8-Pg for qemu-devel@nongnu.org; Sun, 13 Mar 2016 12:00:26 -0400 Received: from mail-vk0-x229.google.com ([2607:f8b0:400c:c05::229]:34385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af8RN-0001q0-Jo for qemu-devel@nongnu.org; Sun, 13 Mar 2016 12:00:25 -0400 Received: by mail-vk0-x229.google.com with SMTP id e185so183674634vkb.1 for ; Sun, 13 Mar 2016 09:00:25 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <8768A4C2-CEBF-411A-9B43-9F43EA755238@gmail.com> From: Peter Maydell Date: Sun, 13 Mar 2016 16:00:05 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 4/4] hw/input/adb.c: implement QKeyCode support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid Cc: Gerd Hoffmann , qemu-devel qemu-devel On 12 March 2016 at 04:27, Programmingkid wrote: > > On Mar 11, 2016, at 10:30 PM, Peter Maydell wrote: > >> On 11 March 2016 at 09:32, Programmingkid wrote: >>> Remove the old pc_to_adb_keycode array and replace it with QKeyCode support. >>> >>> Signed-off-by: John Arbuckle >>> --- >>> Some of the keys do not translate as logically as we would think they would. For >>> example the Q_KEY_CODE_CTRL_R does not work with ADB_KEY_RIGHT_CONTROL. The >>> wrong key would show up in the guest. These problem keys are commmented out and >>> replaced with the number that does work correctly. This patch can be easily >>> tested with the Linux command xev or Mac OS's Key Caps. >> >> I'm not sure what you mean here. If you press right-control on the host >> then shouldn't this correspond to right-control on the guest ? > > It should. It makes logical sense. But when I tried it using a Mac OS X and > Linux guest, the wrong key would be pressed. The theories I have are > incorrect keyboard detection to CUDA translation problems. > >>> + [Q_KEY_CODE_SHIFT] = ADB_KEY_LEFT_SHIFT, >>> + [Q_KEY_CODE_SHIFT_R] = 123, /* ADB_KEY_RIGHT_SHIFT, */ >> >> These should definitely be using some ADB_KEY_* constant on >> the RHS, not a decimal constant. > > Ok. It would look something like this: > [Q_KEY_CODE_SHIFT_R] = ADB_KEY_LEFT, I think we definitely need to figure out what is going on here. Sending the key-left code for right-shift is definitely wrong. (Presumably this also implies that the actual left-arrow key is broken...) Possibly relatedly, the Apple Extended Keyboard apparently won't send the separate keycodes for right-shift, right-option, right-control until the guest OS sends the keyboard a command to enable them. (see http://www.archive.org/stream/apple-guide-macintosh-family-hardware/Apple_Guide_to_the_Macintosh_Family_Hardware_2e#page/n347/mode/2up page 309). I suggest that for this patchset you leave the code so that it continues to send the same ADB keycodes for these keys that it has done before (whatever those are). Then once we've got the conversion to using qcodes in we can look at fixing this bug as a separate patch. (Similarly, you might want to split out the code to support the power key as a separate patch.) thanks -- PMM