From patchwork Thu Jul 26 04:48:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 173333 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 89F8D2C0091 for ; Thu, 26 Jul 2012 14:49:00 +1000 (EST) Received: from localhost ([::1]:46835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuG0Q-00085q-An for incoming@patchwork.ozlabs.org; Thu, 26 Jul 2012 00:48:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuG08-0007uW-93 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 00:48:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuG07-0006kJ-9a for qemu-devel@nongnu.org; Thu, 26 Jul 2012 00:48:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuG07-0006kE-1e for qemu-devel@nongnu.org; Thu, 26 Jul 2012 00:48:39 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6Q4mcSE012580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Jul 2012 00:48:38 -0400 Received: from dhcp-8-167.nay.redhat.com ([10.66.7.126]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6Q4mTtu013480; Thu, 26 Jul 2012 00:48:36 -0400 From: Amos Kong To: qemu-devel@nongnu.org Date: Thu, 26 Jul 2012 12:48:57 +0800 Message-Id: <1343278141-10843-3-git-send-email-akong@redhat.com> In-Reply-To: <1343278141-10843-1-git-send-email-akong@redhat.com> References: <1343278141-10843-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, Amos Kong , eblake@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v5 2/6] 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 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 renames '<' to 'less', QAPI would 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 49dccfe..ffec616 100644 --- a/monitor.c +++ b/monitor.c @@ -1403,7 +1403,7 @@ static const KeyDef key_defs[] = { { 0x48, "kp_8" }, { 0x49, "kp_9" }, - { 0x56, "<" }, + { 0x56, "less" }, { 0x57, "f11" }, { 0x58, "f12" }, @@ -1507,6 +1507,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) {