| Flutter iOS Embedder |

Enumerations | Variables
KeyCodeMap_Internal.h File Reference
`#import <UIKit/UIKit.h>`
`#include <map>`
`#include <set>`

Go to the source code of this file.

## Enumerations
enum | ModifierFlag { kModifierFlagControlLeft = 0x1 , kModifierFlagShiftLeft = 0x2 , kModifierFlagShiftRight = 0x4 , kModifierFlagMetaLeft = 0x8 , kModifierFlagMetaRight = 0x10 , kModifierFlagAltLeft = 0x20 , kModifierFlagAltRight = 0x40 , kModifierFlagControlRight = 0x2000 , kModifierFlagCapsLock = UIKeyModifierAlphaShift , kModifierFlagShiftAny = UIKeyModifierShift , kModifierFlagControlAny = UIKeyModifierControl , kModifierFlagAltAny = UIKeyModifierAlternate , kModifierFlagMetaAny = UIKeyModifierCommand , kModifierFlagNumPadKey = UIKeyModifierNumericPad }

## Variables
const std::map< uint32_t, uint64_t > | keyCodeToPhysicalKey
const std::map< uint32_t, uint64_t > | keyCodeToLogicalKey
NSDictionary< NSString *, NSNumber * > * | specialKeyMapping
const uint64_t | kValueMask
const uint64_t | kUnicodePlane
const uint64_t | kIosPlane
const uint64_t | kCapsLockPhysicalKey
const uint64_t | kCapsLockLogicalKey
constexpr uint32_t | kModifierFlagAnyMask
constexpr uint32_t | kModifierFlagSidedMask
const std::map< uint32_t, ModifierFlag > | keyCodeToModifierFlag
const std::map< ModifierFlag, uint32_t > | modifierFlagToKeyCode
const std::map< ModifierFlag, ModifierFlag > | sidedModifierToAny
const std::map< ModifierFlag, ModifierFlag > | anyModifierToLeft
const std::set< uint32_t > | functionKeyCodes

## Enumeration Type Documentation

## ◆ ModifierFlag

enum ModifierFlag

Bits in |UIKey.modifierFlags| indicating whether a modifier key is pressed.

Enumerator
kModifierFlagControlLeft |
kModifierFlagShiftLeft |
kModifierFlagShiftRight |
kModifierFlagMetaLeft |
kModifierFlagMetaRight |
kModifierFlagAltLeft |
kModifierFlagAltRight |
kModifierFlagControlRight |
kModifierFlagCapsLock |
kModifierFlagShiftAny |
kModifierFlagControlAny |
kModifierFlagAltAny |
kModifierFlagMetaAny |
kModifierFlagNumPadKey |

Definition at line 61 of file KeyCodeMap_Internal.h.

61 {
62 // These sided flags are not in any official Apple docs, they are derived from
63 // experiments.
64 kModifierFlagControlLeft = 0x1,
65 kModifierFlagShiftLeft = 0x2,
66 kModifierFlagShiftRight = 0x4,
67 kModifierFlagMetaLeft = 0x8,
68 kModifierFlagMetaRight = 0x10,
69 kModifierFlagAltLeft = 0x20,
70 kModifierFlagAltRight = 0x40,
71 kModifierFlagControlRight = 0x2000,
72
73 // These are equivalent to non-sided iOS values.
74 kModifierFlagCapsLock = UIKeyModifierAlphaShift, // 0x010000
75 kModifierFlagShiftAny = UIKeyModifierShift, // 0x020000
76 kModifierFlagControlAny = UIKeyModifierControl, // 0x040000
77 kModifierFlagAltAny = UIKeyModifierAlternate, // 0x080000
78 kModifierFlagMetaAny = UIKeyModifierCommand, // 0x100000
79 kModifierFlagNumPadKey = UIKeyModifierNumericPad // 0x200000
80 } ModifierFlag;
ModifierFlag
ModifierFlag
Definition: KeyCodeMap_Internal.h:61
kModifierFlagCapsLock
@ kModifierFlagCapsLock
Definition: KeyCodeMap_Internal.h:74
kModifierFlagNumPadKey
@ kModifierFlagNumPadKey
Definition: KeyCodeMap_Internal.h:79
kModifierFlagControlLeft
@ kModifierFlagControlLeft
Definition: KeyCodeMap_Internal.h:64
kModifierFlagAltRight
@ kModifierFlagAltRight
Definition: KeyCodeMap_Internal.h:70
kModifierFlagShiftAny
@ kModifierFlagShiftAny
Definition: KeyCodeMap_Internal.h:75
kModifierFlagControlRight
@ kModifierFlagControlRight
Definition: KeyCodeMap_Internal.h:71
kModifierFlagMetaAny
@ kModifierFlagMetaAny
Definition: KeyCodeMap_Internal.h:78
kModifierFlagMetaRight
@ kModifierFlagMetaRight
Definition: KeyCodeMap_Internal.h:68
kModifierFlagShiftLeft
@ kModifierFlagShiftLeft
Definition: KeyCodeMap_Internal.h:65
kModifierFlagShiftRight
@ kModifierFlagShiftRight
Definition: KeyCodeMap_Internal.h:66
kModifierFlagControlAny
@ kModifierFlagControlAny
Definition: KeyCodeMap_Internal.h:76
kModifierFlagAltLeft
@ kModifierFlagAltLeft
Definition: KeyCodeMap_Internal.h:69
kModifierFlagMetaLeft
@ kModifierFlagMetaLeft
Definition: KeyCodeMap_Internal.h:67
kModifierFlagAltAny
@ kModifierFlagAltAny
Definition: KeyCodeMap_Internal.h:77

## Variable Documentation

## ◆ anyModifierToLeft

const std::map<ModifierFlag, ModifierFlag> anyModifierToLeft
| extern

Maps a non-sided modifier key to the corresponding flag matching the left key of that type of modifier.

## ◆ functionKeyCodes

const std::set<uint32_t> functionKeyCodes
| extern

A set of keycodes corresponding to function keys.

Definition at line 304 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::getEventCharacters().

## ◆ kCapsLockLogicalKey

const uint64_t kCapsLockLogicalKey
| extern

The logical key for CapsLock, which needs special handling.

Definition at line 357 of file KeyCodeMap.g.mm.

## ◆ kCapsLockPhysicalKey

const uint64_t kCapsLockPhysicalKey
| extern

The physical key for CapsLock, which needs special handling.

Definition at line 356 of file KeyCodeMap.g.mm.

## ◆ keyCodeToLogicalKey

const std::map<uint32_t, uint64_t> keyCodeToLogicalKey
| extern

A map from iOS key codes to Flutter's logical key values.

This is used to derive logical keys that can't or shouldn't be derived from |charactersIgnoringModifiers|.

Definition at line 201 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::GetLogicalKeyForEvent(), and FLUTTER_ASSERT_ARC::GetLogicalKeyForModifier().

## ◆ keyCodeToModifierFlag

const std::map<uint32_t, ModifierFlag> keyCodeToModifierFlag
| extern

Map |UIKey.keyCode| to the matching sided modifier in UIEventModifierFlags.

Definition at line 279 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::computeModifierFlagOfInterestMask().

## ◆ keyCodeToPhysicalKey

const std::map<uint32_t, uint64_t> keyCodeToPhysicalKey
| extern

Maps iOS-specific key code values representing |PhysicalKeyboardKey|.

MacOS doesn't provide a scan code, but a virtual keycode to represent a physical key.

Definition at line 37 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::GetPhysicalKeyForKeyCode().

## ◆ kIosPlane

const uint64_t kIosPlane
| extern

The plane value for the private keys defined by the iOS embedding.

Definition at line 32 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::GetLogicalKeyForEvent(), FLUTTER_ASSERT_ARC::GetLogicalKeyForModifier(), and FLUTTER_ASSERT_ARC::GetPhysicalKeyForKeyCode().

## ◆ kModifierFlagAnyMask

constexpr uint32_t kModifierFlagAnyMask
| constexpr

Initial value:
=
kModifierFlagShiftAny | kModifierFlagControlAny | kModifierFlagAltAny | kModifierFlagMetaAny

A mask of all the modifier flags that represent a modifier being pressed, but not whether it is the left or right modifier.

Definition at line 86 of file KeyCodeMap_Internal.h.

## ◆ kModifierFlagSidedMask

constexpr uint32_t kModifierFlagSidedMask
| constexpr

Initial value:
= kModifierFlagControlLeft | kModifierFlagShiftLeft |
kModifierFlagShiftRight | kModifierFlagMetaLeft |
kModifierFlagMetaRight | kModifierFlagAltLeft |
kModifierFlagAltRight | kModifierFlagControlRight

A mask of the modifier flags that represent only left or right modifier keys, and not the generic "Any" mask.

Definition at line 93 of file KeyCodeMap_Internal.h.

Referenced by flutter::testing::keyEventWithPhase().

## ◆ kUnicodePlane

const uint64_t kUnicodePlane
| extern

The plane value for keys which have a Unicode representation.

Definition at line 27 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::GetLogicalKeyForEvent().

## ◆ kValueMask

const uint64_t kValueMask
| extern

Mask for the 32-bit value portion of the key code.

Definition at line 22 of file KeyCodeMap.g.mm.

Referenced by FLUTTER_ASSERT_ARC::KeyOfPlane().

## ◆ modifierFlagToKeyCode

const std::map<ModifierFlag, uint32_t> modifierFlagToKeyCode
| extern

Map a bit of bitmask of sided modifiers in UIEventModifierFlags to their corresponding |UIKey.keyCode|.

Definition at line 291 of file KeyCodeMap.g.mm.

## ◆ sidedModifierToAny

const std::map<ModifierFlag, ModifierFlag> sidedModifierToAny
| extern

Maps a sided modifier key to the corresponding flag matching either side of that type of modifier.

## ◆ specialKeyMapping

NSDictionary<NSString*, NSNumber*>* specialKeyMapping
| extern

Maps iOS specific string values of nonvisible keys to logical keys.

TODO(dkwingsmt): Change this getter function to a global variable. I tried to do this but the unit test on CI threw errors saying "message sent to deallocated instance" on the NSDictionary.

See: https://developer.apple.com/documentation/uikit/uikeycommand/input_strings_for_special_keys?language=objc

Definition at line 332 of file KeyCodeMap.g.mm.