From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab9MH-0004Wd-Nv for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:10:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab9MC-00027D-Gs for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:10:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab9MC-00026z-CT for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:10:36 -0500 Message-ID: <1456935034.23994.136.camel@redhat.com> From: Gerd Hoffmann Date: Wed, 02 Mar 2016 17:10:34 +0100 In-Reply-To: References: <801CD73C-2AB1-4421-9C09-1F7AE46AA272@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] hw/input/adb.c: Replace pc_to_adb_keycode with more detailed array List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Programmingkid , qemu-devel qemu-devel Hi, > In any case this whole array ought at some point to be > replaced with a Q_KEY code to ADB code lookup -- at the > moment we will convert Q_KEY to pc scancode to ADB code, > which is unfortunate if the pc scancodes don't include > some keys that ADB and the host keyboard do. (In fact, > wasn't this the reason why you wanted to do these patches?) /me suggests: Step #1: convert adb.c to the new input api, check "commit 66e6536 input: switch ps/2 kbd to new input api" how to do it. Step #2: remove pc scancodes from translation, by moving from qemu_input_key_value_to_scancode to qemu_input_key_value_to_qcode and replacing the pc_to_adb_keycode[] map by a qcode_to_adb_keycode map. Which will also simplify the lookup because you don't have to worry about extended keycodes (scancode =3D=3D 0xe0) any more. You might also inspect commit "65e7545 input: switch sparc32 kbd to new input api" which does the same for sparc (with both steps in one commit). cheers, Gerd