Flutter Engine
The Flutter Engine
|
#import <FlutterEmbedderKeyResponder.h>
Properties | |
FlutterSendKeyEvent | sendEvent [implementation] |
FlutterSendEmbedderKeyEvent | sendEvent [implementation] |
NSMutableDictionary< NSNumber *, NSNumber * > * | pressingRecords [implementation] |
NSUInteger | modifierFlagOfInterestMask [implementation] |
NSUInteger | lastModifierFlagsOfInterest [implementation] |
uint64_t | responseId [implementation] |
NSMutableDictionary< NSNumber *, FlutterAsyncKeyCallback > * | pendingResponses [implementation] |
Properties inherited from <FlutterKeyPrimaryResponder> | |
NSMutableDictionary< NSNumber *, NSNumber * > * | layoutMap |
A primary responder of |FlutterKeyboardManager| that handles events by sending the converted events through a Dart hook to the framework.
This class interfaces with the HardwareKeyboard API in the framework.
A primary responder of |FlutterKeyboardManager| that handles events by sending the converted events through the embedder API.
This class communicates with the HardwareKeyboard API in the framework.
Definition at line 23 of file FlutterEmbedderKeyResponder.h.
|
implementation |
Because iOS differs from other platforms in that the modifier flags still contain the flag for the key that is being released on the keyup event, we adjust the modifiers when the released key is a matching modifier key.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Fix up the modifiers for a particular type of modifier key.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
- (nonnull NSDictionary *) getPressedState |
Returns the keyboard pressed state.
Returns the keyboard pressed state. The dictionary contains one entry per pressed keys, mapping from the logical key to the physical key.
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Process the event.
The |callback| should be called with a value that indicates whether the responder has handled the given press event. The |callback| must be called exactly once, and can be called before the return of this method, or after.
Reimplemented from <FlutterKeyPrimaryResponder>.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Processes a down event from the system.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Processes an up event from the system.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Processes the response from the framework.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
- (nonnull instancetype) initWithSendEvent: | (_Nonnull FlutterSendEmbedderKeyEvent) | sendEvent |
Create an instance by specifying the function to send converted events to.
The |sendEvent| is typically |FlutterEngine|'s |sendKeyEvent|.
|
implementation |
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
- (nonnull instancetype) initWithSendEvent: | (nonnull FlutterSendKeyEvent) | sendEvent |
Create an instance by specifying the function to send converted events to.
The |sendEvent| is typically |FlutterEngine|'s |sendKeyEvent|.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Send an empty key event.
The event is never synthesized, and never expects an event result. An empty event is sent when no other events should be sent, such as upon back-to-back keydown events of the same key.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Send a synthesized key event, never expecting its event result.
The |guard| is basically a regular guarded callback, but instead of being called, it is only used to record whether an event is sent.
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Compare the last modifier flags and the current, and dispatch synthesized key events for each different modifier flag bit.
The flags compared are all flags after masking with |modifierFlagOfInterestMask| and excluding |ignoringFlags|.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
- (void) syncModifiersIfNeeded: | (NSEventModifierFlags) | modifierFlags | |
timestamp: | (NSTimeInterval) | timestamp | |
Synthesize modifier keys events.
If needed, synthesize modifier keys up and down events by comparing their current pressing states with the given modifier flags.
Reimplemented from <FlutterKeyPrimaryResponder>.
Definition at line 386 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Synthesize a CapsLock down event, then a CapsLock up event.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Send a key event for a modifier key.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
implementation |
Update the pressing state.
If logicalKey
is not 0, physicalKey
is pressed as logicalKey
. Otherwise, physicalKey
is released.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
readwritenonatomicassignimplementation |
The modifier flags of the last received key event, excluding uninterested bits.
This should be kept synchronized with the last |NSEvent.modifierFlags| after masking with |modifierFlagOfInterestMask|. This should also be kept synchronized with the corresponding keys of |pressingRecords|.
This is used by |synchronizeModifiers| to quickly find out modifier keys that are desynchronized.
Definition at line 391 of file FlutterEmbedderKeyResponder.mm.
|
readwritenonatomicassignimplementation |
A constant mask for NSEvent.modifierFlags that Flutter synchronizes with.
Flutter keeps track of the last |modifierFlags| and compares it with the incoming one. Any bit within |modifierFlagOfInterestMask| that is different (except for the one that corresponds to the event key) indicates that an event for this modifier was missed, and Flutter synthesizes an event to make up for the state difference.
It is computed by computeModifierFlagOfInterestMask.
Definition at line 378 of file FlutterEmbedderKeyResponder.mm.
|
readwritenonatomicassignimplementation |
A map of unresponded key events sent to the framework.
Its values are |responseId|s, and keys are the callback that was received along with the event.
Definition at line 405 of file FlutterEmbedderKeyResponder.mm.
|
readwritenonatomicassignimplementation |
A map of pressed keys.
The keys of the dictionary are physical keys, while the values are the logical keys of the key down event.
A map of presessd keys.
The keys of the dictionary are physical keys, while the values are the logical keys of the key down event.
Definition at line 365 of file FlutterEmbedderKeyResponder.mm.
|
readwritenonatomicassignimplementation |
A self-incrementing ID used to label key events sent to the framework.
Definition at line 396 of file FlutterEmbedderKeyResponder.mm.
|
readnonatomiccopyimplementation |
The function to send converted events to.
Set by the initializer.
Provided by category FlutterEmbedderKeyResponder(Tests).
Definition at line 357 of file FlutterEmbedderKeyResponder.mm.
|
readwritenonatomiccopyimplementation |
The function to send converted events to.
Set by the initializer.
Definition at line 339 of file FlutterEmbedderKeyResponder.mm.