From patchwork Wed Sep 5 18:58:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 181912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C01B42C0095 for ; Thu, 6 Sep 2012 04:58:32 +1000 (EST) Received: from localhost ([::1]:40176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Ko2-0001st-Q4 for incoming@patchwork.ozlabs.org; Wed, 05 Sep 2012 14:58:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Knh-0001h7-FS for qemu-devel@nongnu.org; Wed, 05 Sep 2012 14:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Knf-0001ZG-Gv for qemu-devel@nongnu.org; Wed, 05 Sep 2012 14:58:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Knf-0001Z0-8m for qemu-devel@nongnu.org; Wed, 05 Sep 2012 14:58:07 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q85Iw6HP017458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Sep 2012 14:58:06 -0400 Received: from localhost (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q85Iw5BU014753; Wed, 5 Sep 2012 14:58:06 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Wed, 5 Sep 2012 15:58:30 -0300 Message-Id: <1346871526-25342-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1346871526-25342-1-git-send-email-lcapitulino@redhat.com> References: <1346871526-25342-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Amos Kong , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 03/19] monitor: rename keyname '<' to 'less' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Amos Kong 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 renamed '<' 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 Signed-off-by: Luiz Capitulino --- monitor.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index b17b1bb..c97c120 100644 --- a/monitor.c +++ b/monitor.c @@ -1400,7 +1400,7 @@ static const KeyDef key_defs[] = { { 0x48, "kp_8" }, { 0x49, "kp_9" }, - { 0x56, "<" }, + { 0x56, "less" }, { 0x57, "f11" }, { 0x58, "f12" }, @@ -1504,6 +1504,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 (!strncmp(keyname_buf, "<", 1) && keyname_len == 1) { + pstrcpy(keyname_buf, sizeof(keyname_buf), "less"); + keyname_len = 4; + } + keyname_buf[keyname_len] = 0; keycode = get_keycode(keyname_buf); if (keycode < 0) {