#include <keyboard_key_channel_handler.h>
◆ KeyboardKeyChannelHandler()
◆ ~KeyboardKeyChannelHandler()
flutter::KeyboardKeyChannelHandler::~KeyboardKeyChannelHandler |
( |
| ) |
|
|
default |
◆ GetPressedState()
std::map< uint64_t, uint64_t > flutter::KeyboardKeyChannelHandler::GetPressedState |
( |
| ) |
|
|
virtual |
◆ KeyboardHook()
void flutter::KeyboardKeyChannelHandler::KeyboardHook |
( |
int |
key, |
|
|
int |
scancode, |
|
|
int |
action, |
|
|
char32_t |
character, |
|
|
bool |
extended, |
|
|
bool |
was_down, |
|
|
std::function< void(bool)> |
callback |
|
) |
| |
|
virtual |
Implements flutter::KeyboardKeyHandler::KeyboardKeyHandlerDelegate.
Definition at line 124 of file keyboard_key_channel_handler.cc.
134 rapidjson::Document event(rapidjson::kObjectType);
135 auto& allocator =
event.GetAllocator();
136 event.AddMember(kKeyCodeKey,
key, allocator);
137 event.AddMember(kScanCodeKey,
scancode | (
extended ? kScancodeExtended : 0),
140 event.AddMember(kKeyMapKey, kWindowsKeyMap, allocator);
141 event.AddMember(kModifiersKey, GetModsForKeyState(), allocator);
146 event.AddMember(kTypeKey, kKeyDown, allocator);
150 event.AddMember(kTypeKey, kKeyUp, allocator);
153 FML_LOG(WARNING) <<
"Unknown key event action: " <<
action;
157 channel_->Send(event, [
callback = std::move(
callback)](
const uint8_t* reply,
161 bool handled = decoded ? (*decoded)[kHandledKey].GetBool() :
false;
References action, callback, character, flutter::MessageCodec< T >::DecodeMessage(), extended, flutter::JsonMessageCodec::GetInstance(), key, scancode, and flutter::UndeadChar().
◆ SyncModifiersIfNeeded()
void flutter::KeyboardKeyChannelHandler::SyncModifiersIfNeeded |
( |
int |
modifiers_state | ) |
|
|
virtual |
The documentation for this class was generated from the following files: