88
99#include " flutter/shell/platform/tizen/tizen_log.h"
1010
11- static constexpr char kChannelName [] = " flutter/keyevent " ;
11+ namespace flutter {
1212
13- static constexpr char kKeyMapKey [] = " keymap" ;
14- static constexpr char kKeyCodeKey [] = " keyCode" ;
15- static constexpr char kScanCodeKey [] = " scanCode" ;
16- static constexpr char kTypeKey [] = " type" ;
17- static constexpr char kModifiersKey [] = " modifiers" ;
18- static constexpr char kToolkitKey [] = " toolkit" ;
19- static constexpr char kUnicodeScalarValuesKey [] = " unicodeScalarValues" ;
13+ namespace {
2014
21- static constexpr char kKeyUp [] = " keyup" ;
22- static constexpr char kKeyDown [] = " keydown" ;
23- static constexpr char kGtkToolkit [] = " gtk" ;
24- static constexpr char kLinuxKeyMap [] = " linux" ;
15+ constexpr char kChannelName [] = " flutter/keyevent" ;
16+
17+ constexpr char kKeyMapKey [] = " keymap" ;
18+ constexpr char kKeyCodeKey [] = " keyCode" ;
19+ constexpr char kScanCodeKey [] = " scanCode" ;
20+ constexpr char kTypeKey [] = " type" ;
21+ constexpr char kModifiersKey [] = " modifiers" ;
22+ constexpr char kToolkitKey [] = " toolkit" ;
23+ constexpr char kUnicodeScalarValuesKey [] = " unicodeScalarValues" ;
24+
25+ constexpr char kKeyUp [] = " keyup" ;
26+ constexpr char kKeyDown [] = " keydown" ;
27+ constexpr char kGtkToolkit [] = " gtk" ;
28+ constexpr char kLinuxKeyMap [] = " linux" ;
2529
2630// Mapping from physical (xkb) to logical (GTK) key codes.
2731// The values are defined in:
2832// - flutter/keyboard_maps.dart (kLinuxToPhysicalKey, kGtkToLogicalKey)
29- static const std::map<int , int > kKeyCodeMap = {
33+ const std::map<int , int > kKeyCodeMap = {
3034 {0x00000009 , 65307 }, // LogicalKeyboardKey.escape
3135 {0x0000000a , 49 }, // LogicalKeyboardKey.digit1
3236 {0x0000000b , 50 }, // LogicalKeyboardKey.digit2
@@ -202,7 +206,7 @@ static const std::map<int, int> kKeyCodeMap = {
202206// The values are defined in:
203207// - efl/Ecore_Input.h
204208// - flutter/raw_keyboard_linux.dart (GtkKeyHelper)
205- static const std::map<int , int > kModifierMap = {
209+ const std::map<int , int > kModifierMap = {
206210 {0x0001 , 1 << 0 }, // SHIFT (modifierShift)
207211 {0x0002 , 1 << 2 }, // CTRL (modifierControl)
208212 {0x0004 , 1 << 3 }, // ALT (modifierMod1)
@@ -212,12 +216,13 @@ static const std::map<int, int> kModifierMap = {
212216 {0x0040 , 1 << 1 }, // CAPS (modifierCapsLock)
213217};
214218
215- KeyEventChannel::KeyEventChannel (flutter::BinaryMessenger* messenger)
216- : channel_(
217- std::make_unique<flutter::BasicMessageChannel<rapidjson::Document>>(
218- messenger,
219- kChannelName ,
220- &flutter::JsonMessageCodec::GetInstance ())) {}
219+ } // namespace
220+
221+ KeyEventChannel::KeyEventChannel (BinaryMessenger* messenger)
222+ : channel_(std::make_unique<BasicMessageChannel<rapidjson::Document>>(
223+ messenger,
224+ kChannelName ,
225+ &JsonMessageCodec::GetInstance ())) {}
221226
222227KeyEventChannel::~KeyEventChannel () {}
223228
@@ -251,3 +256,5 @@ void KeyEventChannel::SendKeyEvent(Ecore_Event_Key* key, bool is_down) {
251256 }
252257 channel_->Send (event);
253258}
259+
260+ } // namespace flutter
0 commit comments