Warning, /network/kdeconnect-ios/KDE Connect/KDE Connect/Swift Backend/KeyEvent.swift is written in an unsupported language. File is not indexed.
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Lucas Wang <lucas.wang@tuta.io> 0003 * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 // 0009 // KeyEvent.swift 0010 // KDE Connect 0011 // 0012 // Created by Claudio Cambra on 25/5/22. 0013 // 0014 0015 import Foundation 0016 0017 // Uniform Key inputs 0018 // swiftlint:disable identifier_name 0019 0020 // KeyEvent is NOT a part of any iOS API, it's a custom enum 0021 // KeyEvent is indeed part of AppKit for macOS (but not any other OS), and SwiftUI for iOS does have 0022 // limited support, but at this time ONLY for external keyboards. 0023 // All of these matches the Android SpecialKeysMap as defined in KeyListenerView.java 0024 // Even if a lot of them are not used in iOS 0025 enum KeyEvent: Int { 0026 case KEYCODE_DEL = 1 0027 case KEYCODE_TAB = 2 0028 // 3 is not used, ENTER share the same value as NUMPAD_ENTER, 12 0029 case KEYCODE_DPAD_LEFT = 4 0030 case KEYCODE_DPAD_UP = 5 0031 case KEYCODE_DPAD_RIGHT = 6 0032 case KEYCODE_DPAD_DOWN = 7 0033 case KEYCODE_PAGE_UP = 8 0034 case KEYCODE_PAGE_DOWN = 9 0035 case KEYCODE_MOVE_HOME = 10 0036 case KEYCODE_MOVE_END = 11 0037 // case KEYCODE_NUMPAD_ENTER = 12 0038 case KEYCODE_ENTER = 12 0039 case KEYCODE_FORWARD_DEL = 13 0040 case KEYCODE_ESCAPE = 14 0041 case KEYCODE_SYSRQ = 15 0042 case KEYCODE_SCROLL_LOCK = 16 0043 // 17 is not used 0044 // 18 is not used 0045 // 19 is not used 0046 // 20 is not used 0047 case KEYCODE_F1 = 21 0048 case KEYCODE_F2 = 22 0049 case KEYCODE_F3 = 23 0050 case KEYCODE_F4 = 24 0051 case KEYCODE_F5 = 25 0052 case KEYCODE_F6 = 26 0053 case KEYCODE_F7 = 27 0054 case KEYCODE_F8 = 28 0055 case KEYCODE_F9 = 29 0056 case KEYCODE_F10 = 30 0057 case KEYCODE_F11 = 31 0058 case KEYCODE_F12 = 32 0059 } 0060 // swiftlint:enable identifier_name