RetroArch/input/drivers_keyboard/keyboard_event_apple.h
yoshisuga bc02f8319e
[iOS] New iOS 13 project to support Swift; Custom keyboard and touch mouse support (#13435)
* Support for Swift, added emulator keyboard

* fixed toggle key handling using magic number hack for now

* fixed keyboard transparency slider for now with suboptimal fix; add gesture recognizer to hide/show keyboard

* Support CocoaView extensions in Swift; move keyboard delegate impl and setup to swift extension

* moved keyboard view model creation out of EmulatorKeyboard

* implement key pressed delegate in swift extension

* added input method for directly sending RETROK_* codes to support a touchscreen keyboard; assign keyboard model delegates; updated keyboard layout (added F1-F12 keys); change shift, control and alt keys to be modifiers

* enable focus mode when custom keyboard is shown; enable/disable overlay when custom keyboard is toggled

* Specify -DHAVE_OPENGLES2 instead of -DHAVE_OPENGLES3 since glsym_es3.h does not compile in iOS 14.5
Fix tvOS build using compiler flags

* Create new project for iOS 13 deploy target; add check for deploy target to conditionally compile for new iOS 13 specific feature (custom keyboard)

* force disable core info caching for iOS, use opengl es2 for debug

* Add flag for iOS custom keyboard - 3-finger swipe up to show, 3-finger swipe down to hide

* use OpenGLES2 instead; using ES3 results in compile time errors on iOS 14.5

* code cleanup

* Updated references to -DDONT_WANT_ARM_ASM_OPTIMIZATIONS flag

* Add JIT support for non-jailbroken devices

* iOS: Add support for touch mouse handler

* Added a HAVE_IOS_TOUCHMOUSE preprocessor macro so that it builds under the iOS11_Metal xcode project

* Changed click-and-drag behavior to double tap hold and drag

* Visual improvements to the emulator keyboard: updated colors, improved key-press effect
2022-02-22 08:21:34 +01:00

178 lines
4.0 KiB
C

/*
Taken from https://github.com/depp/keycode, distributed with the following license:
Copyright 2011-2012 Dietrich Epp <depp@zdome.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* This file is automatically generated by keycode.py. */
#ifndef KEYCODE_KEYCODE_H
#define KEYCODE_KEYCODE_H
#include <stdint.h>
#include <retro_common_api.h>
#ifndef MAX_KEYS
#define MAX_KEYS 256
#endif
enum
{
KEY_A = 4,
KEY_B = 5,
KEY_C = 6,
KEY_D = 7,
KEY_E = 8,
KEY_F = 9,
KEY_G = 10,
KEY_H = 11,
KEY_I = 12,
KEY_J = 13,
KEY_K = 14,
KEY_L = 15,
KEY_M = 16,
KEY_N = 17,
KEY_O = 18,
KEY_P = 19,
KEY_Q = 20,
KEY_R = 21,
KEY_S = 22,
KEY_T = 23,
KEY_U = 24,
KEY_V = 25,
KEY_W = 26,
KEY_X = 27,
KEY_Y = 28,
KEY_Z = 29,
KEY_1 = 30,
KEY_2 = 31,
KEY_3 = 32,
KEY_4 = 33,
KEY_5 = 34,
KEY_6 = 35,
KEY_7 = 36,
KEY_8 = 37,
KEY_9 = 38,
KEY_0 = 39,
KEY_Enter = 40,
KEY_Escape = 41,
KEY_Delete = 42,
KEY_Tab = 43,
KEY_Space = 44,
KEY_Minus = 45,
KEY_Equals = 46,
KEY_LeftBracket = 47,
KEY_RightBracket = 48,
KEY_Backslash = 49,
KEY_Semicolon = 51,
KEY_Quote = 52,
KEY_Grave = 53,
KEY_Comma = 54,
KEY_Period = 55,
KEY_Slash = 56,
KEY_CapsLock = 57,
KEY_F1 = 58,
KEY_F2 = 59,
KEY_F3 = 60,
KEY_F4 = 61,
KEY_F5 = 62,
KEY_F6 = 63,
KEY_F7 = 64,
KEY_F8 = 65,
KEY_F9 = 66,
KEY_F10 = 67,
KEY_F11 = 68,
KEY_F12 = 69,
KEY_PrintScreen = 70,
KEY_ScrollLock = 71,
KEY_Pause = 72,
KEY_Insert = 73,
KEY_Home = 74,
KEY_PageUp = 75,
KEY_DeleteForward = 76,
KEY_End = 77,
KEY_PageDown = 78,
KEY_Right = 79,
KEY_Left = 80,
KEY_Down = 81,
KEY_Up = 82,
KP_NumLock = 83,
KP_Divide = 84,
KP_Multiply = 85,
KP_Subtract = 86,
KP_Add = 87,
KP_Enter = 88,
KP_1 = 89,
KP_2 = 90,
KP_3 = 91,
KP_4 = 92,
KP_5 = 93,
KP_6 = 94,
KP_7 = 95,
KP_8 = 96,
KP_9 = 97,
KP_0 = 98,
KP_Point = 99,
KEY_NonUSBackslash = 100,
KP_Equals = 103,
KEY_F13 = 104,
KEY_F14 = 105,
KEY_F15 = 106,
KEY_F16 = 107,
KEY_F17 = 108,
KEY_F18 = 109,
KEY_F19 = 110,
KEY_F20 = 111,
KEY_F21 = 112,
KEY_F22 = 113,
KEY_F23 = 114,
KEY_F24 = 115,
KEY_Help = 117,
KEY_Menu = 118,
KEY_LeftControl = 224,
KEY_LeftShift = 225,
KEY_LeftAlt = 226,
KEY_LeftGUI = 227,
KEY_RightControl = 228,
KEY_RightShift = 229,
KEY_RightAlt = 230,
KEY_RightGUI = 231
};
RETRO_BEGIN_DECLS
void apple_input_keyboard_event(bool down,
unsigned code, uint32_t character, uint32_t mod, unsigned device);
void apple_direct_input_keyboard_event(bool down,
unsigned code, uint32_t character, uint32_t mod, unsigned device);
RETRO_END_DECLS
#endif