Flutter Engine
 
Loading...
Searching...
No Matches
FlutterEmbedderKeyResponder Class Reference

#include <FlutterEmbedderKeyResponder.h>

Inheritance diagram for FlutterEmbedderKeyResponder:
<FlutterKeyPrimaryResponder> <FlutterKeyPrimaryResponder>

Instance Methods

(nonnull instancetype) - initWithSendEvent:
 
(nonnull instancetype) - initWithSendEvent:
 
(void) - syncModifiersIfNeeded:timestamp:
 
(nonnull NSDictionary *) - getPressedState
 
- Instance Methods inherited from <FlutterKeyPrimaryResponder>
(void) - handlePress:callback:
 
(void) - handleEvent:callback:
 

Additional Inherited Members

- Properties inherited from <FlutterKeyPrimaryResponder>
NSMutableDictionary< NSNumber *, NSNumber * > * layoutMap
 

Detailed Description

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.

Method Documentation

◆ getPressedState

- (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.

798 {
799 return [NSDictionary dictionaryWithDictionary:_pressingRecords];
800}

References self.

◆ initWithSendEvent: [1/2]

- (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|.

◆ initWithSendEvent: [2/2]

- (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|.

◆ syncModifiersIfNeeded:timestamp:

- (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.

785 :(NSEventModifierFlags)modifierFlags
786 timestamp:(NSTimeInterval)timestamp {
787 FlutterAsyncKeyCallback replyCallback = ^(BOOL handled) {
788 // Do nothing.
789 };
790 FlutterKeyCallbackGuard* guardedCallback =
791 [[FlutterKeyCallbackGuard alloc] initWithCallback:replyCallback];
792 [self synchronizeModifiers:modifierFlags
793 ignoringFlags:0
794 timestamp:timestamp
795 guard:guardedCallback];
796}
void(^ FlutterAsyncKeyCallback)(BOOL handled)
int BOOL

The documentation for this class was generated from the following files: