#include <gdk/gdk.h>
#include <functional>
#include "flutter/shell/platform/linux/fl_key_responder.h"
#include "flutter/shell/platform/linux/fl_keyboard_manager.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"
Go to the source code of this file.
Macros | |
#define | FL_TYPE_KEY_EMBEDDER_RESPONDER fl_key_embedder_responder_get_type() |
Typedefs | |
typedef void(* | EmbedderSendKeyEvent) (const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *callback_user_data, void *send_key_event_user_data) |
Functions | |
G_DECLARE_FINAL_TYPE (FlKeyEmbedderResponder, fl_key_embedder_responder, FL, KEY_EMBEDDER_RESPONDER, GObject) | |
FlKeyEmbedderResponder * | fl_key_embedder_responder_new (EmbedderSendKeyEvent send_key_event, void *send_key_event_user_data) |
void | fl_key_embedder_responder_sync_modifiers_if_needed (FlKeyEmbedderResponder *responder, guint state, double event_time) |
GHashTable * | fl_key_embedder_responder_get_pressed_state (FlKeyEmbedderResponder *responder) |
Variables | |
constexpr int | kMaxConvertedKeyData = 3 |
#define FL_TYPE_KEY_EMBEDDER_RESPONDER fl_key_embedder_responder_get_type() |
Definition at line 36 of file fl_key_embedder_responder.h.
typedef void(* EmbedderSendKeyEvent) (const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *callback_user_data, void *send_key_event_user_data) |
Definition at line 29 of file fl_key_embedder_responder.h.
GHashTable* fl_key_embedder_responder_get_pressed_state | ( | FlKeyEmbedderResponder * | responder | ) |
fl_key_embedder_responder_get_pressed_state: @responder: the #FlKeyEmbedderResponder self.
Returns the keyboard pressed state. The hash table contains one entry per pressed keys, mapping from the logical key to the physical key.
Definition at line 895 of file fl_key_embedder_responder.cc.
Referenced by fl_keyboard_manager_get_pressed_state().
FlKeyEmbedderResponder* fl_key_embedder_responder_new | ( | EmbedderSendKeyEvent | send_key_event, |
void * | send_key_event_user_data | ||
) |
FlKeyEmbedderResponder:
A #FlKeyResponder that handles events by sending the converted events through the embedder API.
This class communicates with the HardwareKeyboard API in the framework. fl_key_embedder_responder_new: @engine: The #FlEngine, whose the embedder API will be used to send the event.
Creates a new #FlKeyEmbedderResponder. @send_key_event: a function that is called on every key event. @send_key_event_user_data: an opaque pointer that will be sent back as the last argument of send_key_event, created and managed by the object that holds FlKeyEmbedderResponder.
Returns: a new #FlKeyEmbedderResponder.
Definition at line 263 of file fl_key_embedder_responder.cc.
References FL_TYPE_EMBEDDER_RESPONDER_USER_DATA, initialize_lock_bit_to_checked_keys(), initialize_logical_key_to_lock_bit_loop_body(), initialize_modifier_bit_to_checked_keys(), and send_key_event().
Referenced by fl_keyboard_manager_new(), and TEST().
void fl_key_embedder_responder_sync_modifiers_if_needed | ( | FlKeyEmbedderResponder * | responder, |
guint | state, | ||
double | event_time | ||
) |
fl_key_embedder_responder_sync_modifiers_if_needed: @responder: the #FlKeyEmbedderResponder self. @state: the state of the modifiers mask. @event_time: the time attribute of the incoming GDK event.
If needed, synthesize modifier keys up and down event by comparing their current pressing states with the given modifiers mask.
Definition at line 878 of file fl_key_embedder_responder.cc.
References kMicrosecondsPerMillisecond, state, and synchronize_pressed_states_loop_body().
Referenced by fl_keyboard_manager_sync_modifier_if_needed().
G_DECLARE_FINAL_TYPE | ( | FlKeyEmbedderResponder | , |
fl_key_embedder_responder | , | ||
FL | , | ||
KEY_EMBEDDER_RESPONDER | , | ||
GObject | |||
) |
|
constexpr |
Definition at line 16 of file fl_key_embedder_responder.h.