From patchwork Thu Jun 30 21:32:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 9208981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 959146075A for ; Thu, 30 Jun 2016 21:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A0702868C for ; Thu, 30 Jun 2016 21:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CE4D28693; Thu, 30 Jun 2016 21:35:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UPPERCASE_50_75 autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 35B322868C for ; Thu, 30 Jun 2016 21:35:27 +0000 (UTC) Received: from localhost ([::1]:52694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIjcK-0007mT-G0 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Jun 2016 17:35:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIjbn-0007ls-K3 for qemu-devel@nongnu.org; Thu, 30 Jun 2016 17:34:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIjbk-0001Tg-G1 for qemu-devel@nongnu.org; Thu, 30 Jun 2016 17:34:51 -0400 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:34322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIjbk-0001TU-9g for qemu-devel@nongnu.org; Thu, 30 Jun 2016 17:34:48 -0400 Received: by mail-it0-x241.google.com with SMTP id f6so293929ith.1 for ; Thu, 30 Jun 2016 14:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yWm5wh/slLb7lmTljGNzheb2LaP34qwPPBxtV7aCrq4=; b=lNOs3y2GKvK1mAL+3Psv+tXr5AG+0TdT9UXU60tXx1HNWmjCFb9Mkpm5k4zqtBvvl2 tppc9OLOXuT2cHY8tRY0OC+kqrmORSHWcuI09XcakT+SDb5OWwLoLhXcYJGHIfloTvNf VuNYdBlZbuWsmEJ55ScQa6B9IAXZJZL0CI05B4taw022Ppp12pFYRKyan5nspp5rWTR/ nyTZXhKUfXbMYRr481WXh7ttZDYz8XZlJWU1ggIgimd4WfQgHoa3DqhQF6G5SMFwYZvM P8d50mEQJsayWgdxc0br3wqcomCpoWH3r7gWMXOnSJb7bDDj7JNZMwt6O0UM6wbhD9CR yz9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yWm5wh/slLb7lmTljGNzheb2LaP34qwPPBxtV7aCrq4=; b=HG9HiRsz+MCPWuf9CigAxxn73NFMB+v+P8nLAgXLpicvjRMEpCaLB4TzXyRTK7MBgW bLX+weKbzIoP5SWniNgsc6kYTtAPy6Djs7zVg/8jsegW0gSoL5tlpIgGTfxYyFpwhNFZ 5/bswmBlgm9M1+uLSj+D3+9w+7vKzhU+jPEwL7Uy8uD8K4j4Tvam6DUYdX0HGR2haRFN rcScFuSJcA0HpAG9YfAN2tpjoaZIMVrFPw/Lsdqm+uCAEPIVgRp7L3Ew8D/KtZ0gY3od ajJY1p/XqVJ8ZURGbvn72DRXVDG2FKNZfSn/HHJBu5hvUlCny4xW/tKwXJJBM/FzIoaf QhhA== X-Gm-Message-State: ALyK8tKDNe4oLrjaco0vJsYZVNEncZ1z1L5RcycQ/c+WeMHdUpO3RxmcdVSG6cMDDxfkFQ== X-Received: by 10.36.222.85 with SMTP id d82mr17683950itg.1.1467322487744; Thu, 30 Jun 2016 14:34:47 -0700 (PDT) Received: from localhost.localdomain (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by smtp.gmail.com with ESMTPSA id w78sm802610ita.3.2016.06.30.14.34.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 14:34:46 -0700 (PDT) From: John Arbuckle To: eblake@redhat.com, qemu-devel@nongnu.org Date: Thu, 30 Jun 2016 17:32:18 -0400 Message-Id: <1467322340-25602-2-git-send-email-programmingkidx@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1467322340-25602-1-git-send-email-programmingkidx@gmail.com> References: <1467322340-25602-1-git-send-email-programmingkidx@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::241 Subject: [Qemu-devel] [PATCH 1/3] usb-keys.h: initial commit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Arbuckle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Create an emum of all the USB HID keyboard values. Signed-off-by: John Arbuckle --- include/hw/input/usb-keys.h | 154 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 include/hw/input/usb-keys.h diff --git a/include/hw/input/usb-keys.h b/include/hw/input/usb-keys.h new file mode 100644 index 0000000..6a9fba8 --- /dev/null +++ b/include/hw/input/usb-keys.h @@ -0,0 +1,154 @@ +/* + * QEMU USB HID Emulator + * + * Copyright (c) 2016 John Arbuckle + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * File: usb-keys.h + * Description: Creates an enum of all the USB keycodes. + * Additional information: http://www.usb.org/developers/hidpage/Hut1_12v2.pdf + * page 53 + */ + +#ifndef USB_KEYS_H +#define USB_KEYS_H + +enum { + USB_HID_A = 0x04, + USB_HID_B = 0x05, + USB_HID_C = 0x06, + USB_HID_D = 0x07, + USB_HID_E = 0x08, + USB_HID_F = 0x09, + USB_HID_G = 0x0a, + USB_HID_H = 0x0b, + USB_HID_I = 0x0c, + USB_HID_J = 0x0d, + USB_HID_K = 0x0e, + USB_HID_L = 0x0f, + USB_HID_M = 0x10, + USB_HID_N = 0x11, + USB_HID_O = 0x12, + USB_HID_P = 0x13, + USB_HID_Q = 0x14, + USB_HID_R = 0x15, + USB_HID_S = 0x16, + USB_HID_T = 0x17, + USB_HID_U = 0x18, + USB_HID_V = 0x19, + USB_HID_W = 0x1a, + USB_HID_X = 0x1b, + USB_HID_Y = 0x1c, + USB_HID_Z = 0x1d, + + USB_HID_1 = 0x1e, + USB_HID_2 = 0x1f, + USB_HID_3 = 0x20, + USB_HID_4 = 0x21, + USB_HID_5 = 0x22, + USB_HID_6 = 0x23, + USB_HID_7 = 0x24, + USB_HID_8 = 0x25, + USB_HID_9 = 0x26, + USB_HID_0 = 0x27, + + USB_HID_RETURN = 0x28, + USB_HID_ESC = 0x29, + USB_HID_DELETE = 0x2a, + USB_HID_TAB = 0x2b, + USB_HID_SPACE = 0x2c, + USB_HID_MINUS = 0x2d, + USB_HID_EQUALS = 0x2e, + USB_HID_LEFT_BRACKET = 0x2f, + USB_HID_RIGHT_BRACKET = 0x30, + USB_HID_BACKSLASH = 0x31, + USB_HID_NON_US_NUMBER_SIGN = 0x32, + USB_HID_SEMICOLON = 0x33, + USB_HID_QUOTE = 0x34, + USB_HID_GRAVE_ACCENT = 0x35, + USB_HID_COMMA = 0x36, + USB_HID_PERIOD = 0x37, + USB_HID_FORWARD_SLASH = 0x38, + USB_HID_CAPS_LOCK = 0x39, + + USB_HID_F1 = 0x3a, + USB_HID_F2 = 0x3b, + USB_HID_F3 = 0x3c, + USB_HID_F4 = 0x3d, + USB_HID_F5 = 0x3e, + USB_HID_F6 = 0x3f, + USB_HID_F7 = 0x40, + USB_HID_F8 = 0x41, + USB_HID_F9 = 0x42, + USB_HID_F10 = 0x43, + USB_HID_F11 = 0x44, + USB_HID_F12 = 0x45, + USB_HID_PRINT = 0x46, + USB_HID_SCROLL_LOCK = 0x47, + USB_HID_PAUSE = 0x48, + + USB_HID_INSERT = 0x49, + USB_HID_HOME = 0x4a, + USB_HID_PAGE_UP = 0x4b, + USB_HID_FORWARD_DELETE = 0x4c, + USB_HID_END = 0x4d, + USB_HID_PAGE_DOWN = 0x4e, + USB_HID_RIGHT_ARROW = 0x4f, + USB_HID_LEFT_ARROW = 0x50, + USB_HID_DOWN_ARROW = 0x51, + USB_HID_UP_ARROW = 0x52, + + USB_HID_CLEAR = 0x53, + USB_HID_KP_DIVIDE = 0x54, + USB_HID_KP_MULTIPLY = 0x55, + USB_HID_KP_MINUS = 0x56, + USB_HID_KP_ADD = 0x57, + USB_HID_KP_ENTER = 0x58, + USB_HID_KP_1 = 0x59, + USB_HID_KP_2 = 0x5a, + USB_HID_KP_3 = 0x5b, + USB_HID_KP_4 = 0x5c, + USB_HID_KP_5 = 0x5d, + USB_HID_KP_6 = 0x5e, + USB_HID_KP_7 = 0x5f, + USB_HID_KP_8 = 0x60, + USB_HID_KP_9 = 0x61, + USB_HID_KP_0 = 0x62, + USB_HID_KP_PERIOD = 0x63, + + USB_HID_NON_US_BACKSLASH = 0x64, + USB_HID_APPLICATION = 0x65, + USB_HID_POWER = 0x66, + USB_HID_KP_EQUALS = 0x67, + USB_HID_F13 = 0x68, + USB_HID_F14 = 0x69, + USB_HID_F15 = 0x6a, + USB_HID_EXECUTE = 0x74, + USB_HID_HELP = 0x75, + USB_HID_MENU = 0x76, + USB_HID_SELECT = 0x77, + USB_HID_STOP = 0x78, + USB_HID_AGAIN = 0x79, + USB_HID_UNDO = 0x7a, + USB_HID_CUT = 0x7b, + USB_HID_COPY = 0x7c, + USB_HID_PASTE = 0x7d, + USB_HID_FIND = 0x7e, + USB_HID_MUTE = 0x7f, + USB_HID_VOLUME_UP = 0x80, + USB_HID_VOLUME_DOWN = 0x81, + USB_HID_KP_COMMA = 0x85, + + USB_HID_LEFT_CONTROL = 0xe0, + USB_HID_LEFT_SHIFT = 0xe1, + USB_HID_LEFT_OPTION = 0xe2, + USB_HID_LEFT_GUI = 0xe3, + USB_HID_RIGHT_CONTROL = 0xe4, + USB_HID_RIGHT_SHIFT = 0xe5, + USB_HID_RIGHT_OPTION = 0xe6, + USB_HID_RIGHT_GUI = 0xe7, +}; + +#endif /* USB_KEYS_H */