#import <FlutterKeyboardManager.h>
Instance Methods | |
(nonnull instancetype) | - initWithViewDelegate: |
(void) | - handleEvent: |
(BOOL) | - isDispatchingKeyEvent: |
(void) | - syncModifiersIfNeeded:timestamp: |
(nonnull NSDictionary *) | - getPressedState |
Processes keyboard events and cooperate with |TextInputPlugin|.
A keyboard event goes through a few sections, each can choose to handled the event, and only unhandled events can move to the next section:
Definition at line 27 of file FlutterKeyboardManager.h.
- (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 73 of file FlutterKeyboardManager.mm.
- (void) handleEvent: | (nonnull NSEvent*) | event |
Processes a key event.
Unhandled events will be dispatched to the text input system, and possibly the next responder afterwards.
Definition at line 73 of file FlutterKeyboardManager.mm.
- (nonnull instancetype) initWithViewDelegate: | (nonnull id<FlutterKeyboardViewDelegate>) | viewDelegate |
Create a keyboard manager.
The |viewDelegate| is a weak reference, typically implemented by |FlutterViewController|.
Definition at line 73 of file FlutterKeyboardManager.mm.
- (BOOL) isDispatchingKeyEvent: | (nonnull NSEvent *) | event |
Returns yes if is event currently being redispatched.
In some instances (i.e. emoji shortcut) the event may be redelivered by cocoa as key equivalent to FlutterTextInput, in which case it shouldn't be processed again.
- (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.
Definition at line 73 of file FlutterKeyboardManager.mm.