Flutter Linux Embedder
fl_key_mapping.h File Reference
#include <gdk/gdk.h>
#include <cinttypes>
#include <map>
#include <vector>

Go to the source code of this file.

Classes

struct  FlKeyEmbedderCheckedKey
 
struct  LayoutGoal
 

Functions

uint64_t gpointer_to_uint64 (gpointer pointer)
 
gpointer uint64_to_gpointer (uint64_t number)
 
void initialize_modifier_bit_to_checked_keys (GHashTable *table)
 
void initialize_lock_bit_to_checked_keys (GHashTable *table)
 

Variables

std::map< uint64_t, uint64_t > xkb_to_physical_key_map
 
std::map< uint64_t, uint64_t > gtk_keyval_to_logical_key_map
 
const uint64_t kValueMask
 
const uint64_t kUnicodePlane
 
const uint64_t kGtkPlane
 
const std::vector< LayoutGoallayout_goals
 

Function Documentation

◆ gpointer_to_uint64()

uint64_t gpointer_to_uint64 ( gpointer  pointer)
inline

Definition at line 44 of file fl_key_mapping.h.

44  {
45  return pointer == nullptr ? 0 : reinterpret_cast<uint64_t>(pointer);
46 }

Referenced by get_keyboard_state(), hash_table_find_equal_value(), lookup_hash_table(), and reverse_lookup_hash_table().

◆ initialize_lock_bit_to_checked_keys()

void initialize_lock_bit_to_checked_keys ( GHashTable *  table)

Definition at line 444 of file fl_key_mapping.g.cc.

444  {
446 
447  data = g_new(FlKeyEmbedderCheckedKey, 1);
448  g_hash_table_insert(table, GUINT_TO_POINTER(GDK_LOCK_MASK), data);
449  data->is_caps_lock = true;
450  data->primary_physical_key = 0x000070039; // capsLock
451  data->primary_logical_key = 0x00100000104; // capsLock
452 
453  data = g_new(FlKeyEmbedderCheckedKey, 1);
454  g_hash_table_insert(table, GUINT_TO_POINTER(GDK_MOD2_MASK), data);
455  data->is_caps_lock = false;
456  data->primary_physical_key = 0x000070053; // numLock
457  data->primary_logical_key = 0x0010000010a; // numLock
458 }

References FlKeyEmbedderCheckedKey::is_caps_lock, FlKeyEmbedderCheckedKey::primary_logical_key, and FlKeyEmbedderCheckedKey::primary_physical_key.

Referenced by fl_key_embedder_responder_new().

◆ initialize_modifier_bit_to_checked_keys()

void initialize_modifier_bit_to_checked_keys ( GHashTable *  table)

Definition at line 412 of file fl_key_mapping.g.cc.

412  {
414 
415  data = g_new(FlKeyEmbedderCheckedKey, 1);
416  g_hash_table_insert(table, GUINT_TO_POINTER(GDK_SHIFT_MASK), data);
417  data->is_caps_lock = false;
418  data->primary_physical_key = 0x0000700e1; // shiftLeft
419  data->primary_logical_key = 0x00200000102; // shiftLeft
420  data->secondary_logical_key = 0x00200000103; // shiftRight
421 
422  data = g_new(FlKeyEmbedderCheckedKey, 1);
423  g_hash_table_insert(table, GUINT_TO_POINTER(GDK_CONTROL_MASK), data);
424  data->is_caps_lock = false;
425  data->primary_physical_key = 0x0000700e0; // controlLeft
426  data->primary_logical_key = 0x00200000100; // controlLeft
427  data->secondary_logical_key = 0x00200000101; // controlRight
428 
429  data = g_new(FlKeyEmbedderCheckedKey, 1);
430  g_hash_table_insert(table, GUINT_TO_POINTER(GDK_MOD1_MASK), data);
431  data->is_caps_lock = false;
432  data->primary_physical_key = 0x0000700e2; // altLeft
433  data->primary_logical_key = 0x00200000104; // altLeft
434  data->secondary_logical_key = 0x00200000105; // altRight
435 
436  data = g_new(FlKeyEmbedderCheckedKey, 1);
437  g_hash_table_insert(table, GUINT_TO_POINTER(GDK_META_MASK), data);
438  data->is_caps_lock = false;
439  data->primary_physical_key = 0x0000700e3; // metaLeft
440  data->primary_logical_key = 0x00200000106; // metaLeft
441  data->secondary_logical_key = 0x00200000107; // metaRight
442 }

References FlKeyEmbedderCheckedKey::is_caps_lock, FlKeyEmbedderCheckedKey::primary_logical_key, FlKeyEmbedderCheckedKey::primary_physical_key, and FlKeyEmbedderCheckedKey::secondary_logical_key.

Referenced by fl_key_embedder_responder_new().

◆ uint64_to_gpointer()

gpointer uint64_to_gpointer ( uint64_t  number)
inline

Definition at line 48 of file fl_key_mapping.h.

48  {
49  return reinterpret_cast<gpointer>(number);
50 }

Referenced by fl_key_embedder_responder_new(), lookup_hash_table(), possibly_update_lock_bit(), reverse_lookup_hash_table(), update_mapping_record(), and update_pressing_state().

Variable Documentation

◆ gtk_keyval_to_logical_key_map

std::map<uint64_t, uint64_t> gtk_keyval_to_logical_key_map
extern

Definition at line 238 of file fl_key_mapping.g.cc.

Referenced by event_to_logical_key().

◆ kGtkPlane

const uint64_t kGtkPlane
extern

Definition at line 514 of file fl_key_mapping.g.cc.

Referenced by event_to_logical_key(), and event_to_physical_key().

◆ kUnicodePlane

const uint64_t kUnicodePlane
extern

Definition at line 513 of file fl_key_mapping.g.cc.

Referenced by event_to_logical_key().

◆ kValueMask

const uint64_t kValueMask
extern

Definition at line 512 of file fl_key_mapping.g.cc.

Referenced by apply_id_plane().

◆ layout_goals

const std::vector<LayoutGoal> layout_goals
extern

Definition at line 460 of file fl_key_mapping.g.cc.

Referenced by fl_keyboard_manager_init(), guarantee_layout(), and TEST().

◆ xkb_to_physical_key_map

std::map<uint64_t, uint64_t> xkb_to_physical_key_map
extern

Definition at line 18 of file fl_key_mapping.g.cc.

Referenced by event_to_physical_key().