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