From patchwork Tue Mar 1 22:07:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 8470851 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0DF839F8A8 for ; Tue, 1 Mar 2016 22:07:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F8512034C for ; Tue, 1 Mar 2016 22:07:35 +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 30F8A202B8 for ; Tue, 1 Mar 2016 22:07:34 +0000 (UTC) Received: from localhost ([::1]:52500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aasS5-0003TL-Hu for patchwork-qemu-devel@patchwork.kernel.org; Tue, 01 Mar 2016 17:07:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aasRy-0003T1-Ip for qemu-devel@nongnu.org; Tue, 01 Mar 2016 17:07:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aasRt-0008IY-JE for qemu-devel@nongnu.org; Tue, 01 Mar 2016 17:07:26 -0500 Received: from mail-ig0-x22b.google.com ([2607:f8b0:4001:c05::22b]:36960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aasRt-0008IT-C7 for qemu-devel@nongnu.org; Tue, 01 Mar 2016 17:07:21 -0500 Received: by mail-ig0-x22b.google.com with SMTP id z8so29069881ige.0 for ; Tue, 01 Mar 2016 14:07:21 -0800 (PST) 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=8dz0kK2KvbKZ5Xa2fcKA8Zqc5N9K0fuCqlZOrXSGDVQ=; b=jLojlgtgFodfIBzTbhvqBkcfjQipKAL5wnOhGkm6stA/Cl2wXu/ZQNb1bxLeyzPQUX FwkYl1/0aHrRjUAsNHgwf32TshWnrnUILs/pvMKYi/XyAtzVocF8+TYYP9jPbd6GmMgu evQTQ8XCz63rLU2or6Dk4bWJ+u3i/gPkdJhz9lR6fBXy9seBH0W0zEvMVzof7S9cx+so g+HXg2LEKHo7CWFjQ9OR+Iq/00AQdY3iRh3qTr+p43W79EjBLudR2BAbi7aN868z2/4J x8CbIROu0jRlgsT9yY//EBRmgRdFJ0gg//qMK2mkZBgneGzELSdX7HtZ2f4mthj83qO5 6rJw== 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=8dz0kK2KvbKZ5Xa2fcKA8Zqc5N9K0fuCqlZOrXSGDVQ=; b=GQkfgVsPVzqBiXxHu7yp+C7qi+OXnxg/PPSC4X5fZ/5uZDxMnTpVlu79s5Pwd7wxcV syJjj5pyrDZsRRYp8VKnga6AiVTJN+5+BFsCiAX1XofwokR5BGHvWbZLtdnKb+vbynz8 tQj0iJoyRAoUlNlBY+xsLZqBPeT0To4LnTxWRa23yPfv3Km1mpbXAGONDuLLFlEIRhA6 USfNa/JRhGYJdlrL2ErghIBdZUJm8ESWxaM2Mr98t2uoYTgMc72WCXJ4zU6aVjumScdN lmWs1zxGTJ1CDmKRyXu647YGZWS6ckXJgIvynz1gIY98w4voNi4JBu18o+2wV15xKmzD ezhw== X-Gm-Message-State: AD7BkJJSr8oK4+9OQAUzIl5V1tDicjwex9ZRCg+mYxHHT6WAH1JvD2bOSHJ/ADFKsrKTVA== X-Received: by 10.50.27.8 with SMTP id p8mr1402415igg.88.1456870040994; Tue, 01 Mar 2016 14:07:20 -0800 (PST) Received: from [192.168.0.6] (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by smtp.gmail.com with ESMTPSA id n75sm13625228ioe.28.2016.03.01.14.07.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 14:07:20 -0800 (PST) From: Programmingkid Date: Tue, 1 Mar 2016 17:07:19 -0500 Message-Id: To: Peter Maydell , 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::22b Subject: [Qemu-devel] [PATCH] MacKeys.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 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 This patch adds the file MacKeys.h. It is a file that contains all the constants for the Macintosh keyboard keycodes. Signed-off-by: John Arbuckle --- Note to Peter Maydell: I know you wanted me to use the constants from the file HIToolbox/Events.h, but I can't. It only exists on Mac OS X, so other operating systems like Linux would not be able to use it. This file is also used in the adb.c file, so cross-platform compatibility is a must. include/hw/input/MacKeys.h | 139 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 139 insertions(+), 0 deletions(-) create mode 100644 include/hw/input/MacKeys.h diff --git a/include/hw/input/MacKeys.h b/include/hw/input/MacKeys.h new file mode 100644 index 0000000..7d00190 --- /dev/null +++ b/include/hw/input/MacKeys.h @@ -0,0 +1,139 @@ +/* + * MacKeys.h + * + * Provides a enum of all the Macintosh keycodes. + * Note: keys like Power, volume related, and eject are handled at a lower + * level and are not available to QEMU. That doesn't mean we can't + * substitute one key for another. The function keys like F1 make a good + * substitute for these keys. This can be done in the GTK, SDL, or Cocoa + * code. + */ + +enum { + MAC_KEY_A = 0, + MAC_KEY_B = 11, + MAC_KEY_C = 8, + MAC_KEY_D = 2, + MAC_KEY_E = 14, + MAC_KEY_F = 3, + MAC_KEY_G = 5, + MAC_KEY_H = 4, + MAC_KEY_I = 34, + MAC_KEY_J = 38, + MAC_KEY_K = 40, + MAC_KEY_L = 37, + MAC_KEY_M = 46, + MAC_KEY_N = 45, + MAC_KEY_O = 31, + MAC_KEY_P = 35, + MAC_KEY_Q = 12, + MAC_KEY_R = 15, + MAC_KEY_S = 1, + MAC_KEY_T = 17, + MAC_KEY_U = 32, + MAC_KEY_V = 9, + MAC_KEY_W = 13, + MAC_KEY_X = 7, + MAC_KEY_Y = 16, + MAC_KEY_Z = 6, + + MAC_KEY_0 = 29, + MAC_KEY_1 = 18, + MAC_KEY_2 = 19, + MAC_KEY_3 = 20, + MAC_KEY_4 = 21, + MAC_KEY_5 = 23, + MAC_KEY_6 = 22, + MAC_KEY_7 = 26, + MAC_KEY_8 = 28, + MAC_KEY_9 = 25, + + MAC_KEY_GRAVE_ACCENT = 50, + MAC_KEY_MINUS = 27, + MAC_KEY_EQUAL = 24, + MAC_KEY_DELETE = 51, + MAC_KEY_CAPS_LOCK = 57, + MAC_KEY_TAB = 48, + MAC_KEY_RETURN = 36, + MAC_KEY_LEFT_BRACKET = 33, + MAC_KEY_RIGHT_BRACKET = 30, + MAC_KEY_BACKSLASH = 42, + MAC_KEY_SEMICOLON = 41, + MAC_KEY_APOSTROPHE = 39, + MAC_KEY_COMMA = 43, + MAC_KEY_PERIOD = 47, + MAC_KEY_FORWARD_SLASH = 44, + MAC_KEY_LEFT_SHIFT = 56, + MAC_KEY_RIGHT_SHIFT = 60, + MAC_KEY_SPACEBAR = 49, + MAC_KEY_LEFT_CONTROL = 59, + MAC_KEY_RIGHT_CONTROL = 62, + MAC_KEY_LEFT_OPTION = 58, + MAC_KEY_RIGHT_OPTION = 61, + MAC_KEY_LEFT_COMMAND = 55, + MAC_KEY_RIGHT_COMMAND = 54, + + MAC_KEY_KP_0 = 82, + MAC_KEY_KP_1 = 83, + MAC_KEY_KP_2 = 84, + MAC_KEY_KP_3 = 85, + MAC_KEY_KP_4 = 86, + MAC_KEY_KP_5 = 87, + MAC_KEY_KP_6 = 88, + MAC_KEY_KP_7 = 89, + MAC_KEY_KP_8 = 91, + MAC_KEY_KP_9 = 92, + MAC_KEY_KP_PERIOD = 65, + MAC_KEY_KP_ENTER = 76, + MAC_KEY_KP_PLUS = 69, + MAC_KEY_KP_SUBTRACT = 78, + MAC_KEY_KP_MULTIPLY = 67, + MAC_KEY_KP_DIVIDE = 75, + MAC_KEY_KP_EQUAL = 81, + MAC_KEY_KP_CLEAR = 71, + + MAC_KEY_UP = 126, + MAC_KEY_DOWN = 125, + MAC_KEY_LEFT = 123, + MAC_KEY_RIGHT = 124, + + MAC_KEY_HELP = 114, + MAC_KEY_HOME = 115, + MAC_KEY_PAGE_UP = 116, + MAC_KEY_PAGE_DOWN = 121, + MAC_KEY_END = 119, + MAC_KEY_FORWARD_DELETE = 117, + + MAC_KEY_ESC = 53, + MAC_KEY_F1 = 122, + MAC_KEY_F2 = 120, + MAC_KEY_F3 = 99, + MAC_KEY_F4 = 118, + MAC_KEY_F5 = 96, + MAC_KEY_F6 = 97, + MAC_KEY_F7 = 98, + MAC_KEY_F8 = 100, + MAC_KEY_F9 = 101, + MAC_KEY_F10 = 109, + MAC_KEY_F11 = 103, + MAC_KEY_F12 = 111, + MAC_KEY_F13 = 105, + MAC_KEY_F14 = 107, + MAC_KEY_F15 = 113, + + MAC_KEY_VOLUME_UP = 72, + MAC_KEY_VOLUME_DOWN = 73, + MAC_KEY_VOLUME_MUTE = 74, + + /* + * I didn't count the Power key as the largest value because it's very large + * value would cause arrays that depend on MAC_KEY_LARGEST_VALUE to be too + * big. + */ + MAC_KEY_POWER = 32639, + + MAC_KEY_LARGEST_VALUE = MAC_KEY_UP, +}; + +/* Could not find the value for this key. */ +/* #define MAC_KEY_EJECT */