#include <embedder.h>
Public Attributes | |
| size_t | struct_size |
| The size of this struct. Must be sizeof(FlutterKeyEvent). | |
| double | timestamp |
| FlutterKeyEventType | type |
| The event kind. | |
| uint64_t | physical |
| uint64_t | logical |
| const char * | character |
| bool | synthesized |
| FlutterKeyEventDeviceType | device_type |
| The source device for the key event. | |
A structure to represent a key event.
Sending FlutterKeyEvent via FlutterEngineSendKeyEvent results in a corresponding FlutterKeyEvent to be dispatched in the framework. It is embedder's responsibility to ensure the regularity of sent events, since the framework only performs simple one-to-one mapping. The events must conform the following rules:
kind being kFlutterKeyEventTypeDown), zero or more repeat events, and one key up event, representing a physical key button being pressed, held, and released.physical and logical. Having different characters is allowed.A FlutterKeyEvent with physical 0 and logical 0 is an empty event. This is the only case either physical or logical can be 0. An empty event must be sent if a key message should be converted to no FlutterKeyEvents, for example, when a key down message is received for a key that has already been pressed according to the record. This is to ensure some FlutterKeyEvent arrives at the framework before raw key message. See https://github.com/flutter/flutter/issues/87230.
Definition at line 1382 of file embedder.h.
| const char* FlutterKeyEvent::character |
Null-terminated character input from the event. Can be null. Ignored for up events.
Definition at line 1409 of file embedder.h.
Referenced by flutter::testing::_EventEquals(), call_record_new(), fl_key_embedder_call_record_new(), fl_key_embedder_responder_handle_event_impl(), TestKeyEvent::hasCallback, synthesize_simple_event(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
| FlutterKeyEventDeviceType FlutterKeyEvent::device_type |
The source device for the key event.
Definition at line 1424 of file embedder.h.
Referenced by flutter::testing::ExpectKeyEventEq(), TEST(), and flutter::testing::TEST_F().
| uint64_t FlutterKeyEvent::logical |
The key ID for the logical key of this event.
For the full definition and a list of pre-defined logical keys, see LogicalKeyboardKey from the framework.
The only case that logical might be 0 is when this is an empty event. See FlutterKeyEvent for introduction.
Definition at line 1406 of file embedder.h.
Referenced by flutter::testing::_EventEquals(), flutter::testing::ExpectKeyEventEq(), fl_key_embedder_responder_handle_event_impl(), synthesize_simple_event(), TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST_F().
| uint64_t FlutterKeyEvent::physical |
The USB HID code for the physical key of the event.
For the full definition and list of pre-defined physical keys, see PhysicalKeyboardKey from the framework.
The only case that physical might be 0 is when this is an empty event. See FlutterKeyEvent for introduction.
Definition at line 1398 of file embedder.h.
Referenced by flutter::testing::_EventEquals(), flutter::testing::ExpectKeyEventEq(), fl_key_embedder_responder_handle_event_impl(), synthesize_simple_event(), TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST_F().
| size_t FlutterKeyEvent::struct_size |
The size of this struct. Must be sizeof(FlutterKeyEvent).
Definition at line 1384 of file embedder.h.
Referenced by flutter::testing::_EventEquals(), fl_key_embedder_responder_handle_event_impl(), flutter::KeyboardKeyEmbedderHandler::KeyboardHook(), synthesize_simple_event(), TEST(), TEST(), TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| bool FlutterKeyEvent::synthesized |
True if this event does not correspond to a native event.
The embedder is likely to skip events and/or construct new events that do not correspond to any native events in order to conform the regularity of events (as documented in FlutterKeyEvent). An example is when a key up is missed due to loss of window focus, on a platform that provides query to key pressing status, the embedder might realize that the key has been released at the next key event, and should construct a synthesized up event immediately before the actual event.
An event being synthesized means that the timestamp might greatly deviate from the actual time when the event occurs physically.
Definition at line 1422 of file embedder.h.
Referenced by flutter::testing::_EventEquals(), flutter::testing::ExpectKeyEventEq(), fl_key_embedder_responder_handle_event_impl(), synthesize_simple_event(), TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST_F().
| double FlutterKeyEvent::timestamp |
The timestamp at which the key event was generated. The timestamp should be specified in microseconds and the clock should be the same as that used by FlutterEngineGetCurrentTime.
Definition at line 1388 of file embedder.h.
Referenced by flutter::testing::ExpectKeyEventEq(), fl_key_embedder_responder_handle_event_impl(), synthesize_simple_event(), TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterKeyEventType FlutterKeyEvent::type |
The event kind.
Definition at line 1390 of file embedder.h.
Referenced by flutter::testing::_EventEquals(), flutter::testing::ExpectKeyEventEq(), fl_key_embedder_responder_handle_event_impl(), flutter_runner::TextDelegate::OnKeyEvent(), synthesize_simple_event(), TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST_F().