From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScKrp-00026H-OB for qemu-devel@nongnu.org; Wed, 06 Jun 2012 14:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScKro-0003gY-1L for qemu-devel@nongnu.org; Wed, 06 Jun 2012 14:22:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScKrn-0003gS-PX for qemu-devel@nongnu.org; Wed, 06 Jun 2012 14:21:59 -0400 Date: Wed, 6 Jun 2012 15:22:18 -0300 From: Luiz Capitulino Message-ID: <20120606152218.400b1d0a@doriath.home> In-Reply-To: <1338591268-23962-4-git-send-email-akong@redhat.com> References: <1338591268-23962-1-git-send-email-akong@redhat.com> <1338591268-23962-4-git-send-email-akong@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/6] rename keyname '<' to 'less' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org On Sat, 2 Jun 2012 06:54:25 +0800 Amos Kong wrote: > There are many maps of keycode 0x56 in pc-bios/keymaps/* > pc-bios/keymaps/common:less 0x56 > pc-bios/keymaps/common:greater 0x56 shift > pc-bios/keymaps/common:bar 0x56 altgr > pc-bios/keymaps/common:brokenbar 0x56 shift altgr > > This patch just rename '<' to 'less', QAPI might add new > variable by adding a prefix to keyname, '$PREFIX_<' is not > available, '$PREFIX_less' is ok. > > For compatibility, convert user inputted '<' to 'less'. > > Signed-off-by: Amos Kong > --- > monitor.c | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/monitor.c b/monitor.c > index 12a6fe2..ecfcaa4 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -1302,7 +1302,7 @@ static const KeyDef key_defs[] = { > { 0x48, "kp_8" }, > { 0x49, "kp_9" }, > > - { 0x56, "<" }, > + { 0x56, "less" }, > > { 0x57, "f11" }, > { 0x58, "f12" }, > @@ -1406,6 +1406,13 @@ static void do_sendkey(Monitor *mon, const QDict *qdict) > monitor_printf(mon, "too many keys\n"); > return; > } > + > + /* Be compatible with old interface, convert user inputted "<" */ > + if (!strcmp(keyname_buf, "<")) { > + pstrcpy(keyname_buf, sizeof(keyname_buf), "less"); > + keyname_len = 4; > + } I'm not against this change, but it breaks 'sendkey <-a' > + > keyname_buf[keyname_len] = 0; > keycode = get_keycode(keyname_buf); > if (keycode < 0) {