From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn5NT-0007aw-Mo for qemu-devel@nongnu.org; Wed, 21 May 2014 08:12:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn5NN-0006p4-HA for qemu-devel@nongnu.org; Wed, 21 May 2014 08:12:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn5NN-0006oy-7H for qemu-devel@nongnu.org; Wed, 21 May 2014 08:12:05 -0400 From: Gerd Hoffmann Date: Wed, 21 May 2014 14:00:14 +0200 Message-Id: <1400673615-2033-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1400673615-2033-1-git-send-email-kraxel@redhat.com> References: <1400673615-2033-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] input: add name to input_event_key_number List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Signed-off-by: Gerd Hoffmann --- trace-events | 2 +- ui/input.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/trace-events b/trace-events index b6d289d..0870204 100644 --- a/trace-events +++ b/trace-events @@ -1050,7 +1050,7 @@ gd_update(int x, int y, int w, int h) "x=%d, y=%d, w=%d, h=%d" gd_key_event(int gdk_keycode, int qemu_keycode, const char *action) "translated GDK keycode %d to QEMU keycode %d (%s)" # ui/input.c -input_event_key_number(int conidx, int number, bool down) "con %d, key number 0x%x, down %d" +input_event_key_number(int conidx, int number, const char *qcode, bool down) "con %d, key number 0x%x [%s], down %d" input_event_key_qcode(int conidx, const char *qcode, bool down) "con %d, key qcode %s, down %d" input_event_btn(int conidx, const char *btn, bool down) "con %d, button %s, down %d" input_event_rel(int conidx, const char *axis, int value) "con %d, axis %s, value %d" diff --git a/ui/input.c b/ui/input.c index fc91fba..9d63035 100644 --- a/ui/input.c +++ b/ui/input.c @@ -94,7 +94,7 @@ static void qemu_input_transform_abs_rotate(InputEvent *evt) static void qemu_input_event_trace(QemuConsole *src, InputEvent *evt) { const char *name; - int idx = -1; + int qcode, idx = -1; if (src) { idx = qemu_console_get_index(src); @@ -103,8 +103,10 @@ static void qemu_input_event_trace(QemuConsole *src, InputEvent *evt) case INPUT_EVENT_KIND_KEY: switch (evt->key->key->kind) { case KEY_VALUE_KIND_NUMBER: + qcode = qemu_input_key_number_to_qcode(evt->key->key->number); + name = QKeyCode_lookup[qcode]; trace_input_event_key_number(idx, evt->key->key->number, - evt->key->down); + name, evt->key->down); break; case KEY_VALUE_KIND_QCODE: name = QKeyCode_lookup[evt->key->key->qcode]; -- 1.8.3.1