From patchwork Fri Mar 25 16:07:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 8672421 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0CC18C0553 for ; Fri, 25 Mar 2016 16:08:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E0DF202F0 for ; Fri, 25 Mar 2016 16:08:10 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id E97B9202A1 for ; Fri, 25 Mar 2016 16:08:08 +0000 (UTC) Received: from localhost ([::1]:56921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajUHQ-0000F0-9i for patchwork-qemu-devel@patchwork.kernel.org; Fri, 25 Mar 2016 12:08:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajUHI-0000Er-98 for qemu-devel@nongnu.org; Fri, 25 Mar 2016 12:08:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajUHF-0001nn-1P for qemu-devel@nongnu.org; Fri, 25 Mar 2016 12:08:00 -0400 Received: from mail-ig0-x243.google.com ([2607:f8b0:4001:c05::243]:33685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajUHE-0001nj-Qp for qemu-devel@nongnu.org; Fri, 25 Mar 2016 12:07:56 -0400 Received: by mail-ig0-x243.google.com with SMTP id nt3so2361783igb.0 for ; Fri, 25 Mar 2016 09:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:date:message-id:to :mime-version; bh=132cDf7ueycZdvjnYDNh3jVsA3tu5QgJgwURLi22ous=; b=fjVjZaUrM4P/HbGzMoqT9mq8q38PMjZ8bVTNQBqpUMHQZHbw2D4fUMEjZGvbsqf6Yv qFq203VOdvm42UfTptanlLekuGGCQTfwQFXJyhd+OuRaNGtUY7SSXjJ9hf3E6B2tM1MY LXK+vwV+DZYvQOQPkpkdwekU8NHZM58GDQA04ud/NuM3OeFufd4RWlxY5QazenGDSwLK pHPbN/Rrbq91t+JkB/10dcHTGxCn8GbFTbUB1qNQaFNBPEFKVPWZgF17p3U8ZMnDs390 Y5fCH1PbS7eulDjulM/3KjhKgn/g5qPP9vjMW8kL4O6mSOLJDFxwuSuWOqy2zXDiqIwK XDSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject:date :message-id:to:mime-version; bh=132cDf7ueycZdvjnYDNh3jVsA3tu5QgJgwURLi22ous=; b=K8TAQ2GuogOmqQI2OgicOoyc/EybgBpJzs4DBDGwmFbqyjl5dT53xtk51sxN6ol1jZ b3qEBzAzF9WBwUQvQbo4c0q+hD0+2k0bD6VP9LBX9dC0yygxiPkVwuIRv1g0T1Zgg10u XCTqVbsp33gRmc0QBfo2wFRMumNCNj/CYmvUGmCmUS8nWlT1fuA689PGnmyzkOKmphSK Und4uxpE2rL3MknlE+RrPNiJyM6L2yqfKI2TEAs8HNeaQ7BC2odEbHm+N4R7txdM1VCP mr3kOgpxU7mYFH/RjmoCPSpnGRwIWMBcexsDpWbN//ivgd6uHQVqcKrgLY3ZNxHCW7g5 9Gbg== X-Gm-Message-State: AD7BkJJIoo8NtVUnh+geQ42Oq8Pylzbk0Jgr7CS5D4QNTtVO+bgmWWs32cvTo2Fxol3MGw== X-Received: by 10.50.111.8 with SMTP id ie8mr5508635igb.46.1458922076289; Fri, 25 Mar 2016 09:07:56 -0700 (PDT) Received: from [192.168.0.5] (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by smtp.gmail.com with ESMTPSA id hv3sm1511137igb.13.2016.03.25.09.07.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Mar 2016 09:07:55 -0700 (PDT) From: Programmingkid Date: Fri, 25 Mar 2016 12:07:55 -0400 Message-Id: <2DAD5886-8B13-4567-8DE8-E5C0EAD6BEC8@gmail.com> To: Peter Maydell , Gerd Hoffmann , qemu-devel qemu-devel Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c05::243 Subject: [Qemu-devel] [PATCH 1/3] usb-keys.h: initial commit 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY, UPPERCASE_50_75 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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 */