5#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.h"
7#include "flutter/fml/logging.h"
8#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
9#import "flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap_Internal.h"
14- (instancetype)initWithData:(UIPressPhase)phase
16 type:(UIEventType)type
17 timestamp:(NSTimeInterval)timestamp API_AVAILABLE(
ios(13.4)) {
21 _dataKey = [key copy];
23 _dataTimestamp = timestamp;
41 return _dataTimestamp;
46- (instancetype)initWithData:(UIKeyboardHIDUsage)keyCode
47 modifierFlags:(UIKeyModifierFlags)modifierFlags
48 characters:(NSString*)characters
49 charactersIgnoringModifiers:(NSString*)charactersIgnoringModifiers API_AVAILABLE(
ios(13.4)) {
60- (
id)copyWithZone:(NSZone*)zone {
61 FakeUIKey* another = [
super copyWithZone:zone];
75 return _dataModifierFlags;
79 return _dataCharacters;
83 return _dataCharactersIgnoringModifiers;
91 UIKeyModifierFlags modifierFlags,
92 NSTimeInterval timestamp,
93 const char* characters,
94 const char* charactersIgnoringModifiers)
96 return keyEventWithPhase(UIPressPhaseBegan, keyCode, modifierFlags, timestamp, characters,
97 charactersIgnoringModifiers);
101 UIKeyModifierFlags modifierFlags,
102 NSTimeInterval timestamp,
103 const char* characters,
105 return keyEventWithPhase(UIPressPhaseEnded, keyCode, modifierFlags, timestamp, characters,
106 charactersIgnoringModifiers);
110 UIKeyboardHIDUsage keyCode,
111 UIKeyModifierFlags modifierFlags,
112 NSTimeInterval timestamp,
113 const char* characters,
114 const char* charactersIgnoringModifiers)
117 <<
"iOS doesn't supply modifier side flags, so don't create events with them.";
120 modifierFlags:modifierFlags
121 characters:[NSString stringWithUTF8String:characters]
122 charactersIgnoringModifiers:[NSString stringWithUTF8String:charactersIgnoringModifiers]];
126 type:UIEventTypePresses
127 timestamp:timestamp];
#define FML_DCHECK(condition)
UIKeyModifierFlags dataModifierFlags
NSString * dataCharacters
UIKeyboardHIDUsage keyCode()
UIKeyModifierFlags modifierFlags()
NSString * dataCharactersIgnoringModifiers
UIKeyboardHIDUsage dataKeyCode
NSString * charactersIgnoringModifiers()
constexpr uint32_t kModifierFlagSidedMask
SK_API sk_sp< SkSurface > ios(9.0)
FlutterUIPressProxy * keyEventWithPhase(UIPressPhase phase, UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags=0x0, NSTimeInterval timestamp=0.0f, const char *characters="", const char *charactersIgnoringModifiers="") API_AVAILABLE(ios(13.4))
FlutterUIPressProxy * keyUpEvent(UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags=0x0, NSTimeInterval timestamp=0.0f, const char *characters="", const char *charactersIgnoringModifiers="") API_AVAILABLE(ios(13.4))
FlutterUIPressProxy * keyDownEvent(UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags=0x0, NSTimeInterval timestamp=0.0f, const char *characters="", const char *charactersIgnoringModifiers="") API_AVAILABLE(ios(13.4))
API_AVAILABLE(ios(14.0), macos(11.0)) static NSString *MTLCommandEncoderErrorStateToString(MTLCommandEncoderErrorState state)