7 #include "flutter/fml/logging.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,
104 const char* charactersIgnoringModifiers)
API_AVAILABLE(ios(13.4)) {
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];