#include <keyboard_key_embedder_handler.h>
◆ GetKeyStateHandler
◆ MapVirtualKeyToScanCode
◆ SendEventHandler
◆ KeyboardKeyEmbedderHandler()
Definition at line 59 of file keyboard_key_embedder_handler.cc.
63 : perform_send_event_(send_event),
64 get_key_state_(get_key_state),
66 InitCriticalKeys(map_virtual_key_to_scan_code);
◆ ~KeyboardKeyEmbedderHandler()
flutter::KeyboardKeyEmbedderHandler::~KeyboardKeyEmbedderHandler |
( |
| ) |
|
|
virtualdefault |
◆ GetPressedState()
std::map< uint64_t, uint64_t > flutter::KeyboardKeyEmbedderHandler::GetPressedState |
( |
| ) |
|
|
overridevirtual |
◆ KeyboardHook()
void flutter::KeyboardKeyEmbedderHandler::KeyboardHook |
( |
int |
key, |
|
|
int |
scancode, |
|
|
int |
action, |
|
|
char32_t |
character, |
|
|
bool |
extended, |
|
|
bool |
was_down, |
|
|
std::function< void(bool)> |
callback |
|
) |
| |
|
overridevirtual |
Implements flutter::KeyboardKeyHandler::KeyboardKeyHandlerDelegate.
Definition at line 325 of file keyboard_key_embedder_handler.cc.
333 sent_any_events =
false;
336 if (!sent_any_events) {
337 FlutterKeyEvent empty_event{
338 .struct_size =
sizeof(FlutterKeyEvent),
339 .timestamp =
static_cast<double>(
340 std::chrono::duration_cast<std::chrono::microseconds>(
341 std::chrono::high_resolution_clock::now().time_since_epoch())
343 .
type = kFlutterKeyEventTypeDown,
347 .synthesized =
false,
349 SendEvent(empty_event,
nullptr,
nullptr);
References action, callback, character, extended, key, scancode, type, and was_down.
◆ SyncModifiersIfNeeded()
void flutter::KeyboardKeyEmbedderHandler::SyncModifiersIfNeeded |
( |
int |
modifiers_state | ) |
|
|
overridevirtual |
Implements flutter::KeyboardKeyHandler::KeyboardKeyHandlerDelegate.
Definition at line 500 of file keyboard_key_embedder_handler.cc.
502 const uint64_t physical_shift_left =
504 const uint64_t physical_shift_right =
506 const uint64_t logical_shift_left =
508 const uint64_t physical_control_left =
510 const uint64_t physical_control_right =
512 const uint64_t logical_control_left =
515 bool shift_pressed = (modifiers_state &
kShift) != 0;
516 SynthesizeIfNeeded(physical_shift_left, physical_shift_right,
517 logical_shift_left, shift_pressed);
518 bool control_pressed = (modifiers_state &
kControl) != 0;
519 SynthesizeIfNeeded(physical_control_left, physical_control_right,
520 logical_control_left, control_pressed);
References flutter::kControl, flutter::kKeyCodeControlLeft, flutter::kKeyCodeShiftLeft, flutter::kScanCodeControlLeft, flutter::kScanCodeControlRight, flutter::kScanCodeShiftLeft, flutter::kScanCodeShiftRight, and flutter::kShift.
The documentation for this class was generated from the following files: