8
8
9
9
#include " flutter/shell/platform/tizen/tizen_log.h"
10
10
11
- static constexpr char kChannelName [] = " flutter/keyevent " ;
11
+ namespace flutter {
12
12
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 {
20
14
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" ;
25
29
26
30
// Mapping from physical (xkb) to logical (GTK) key codes.
27
31
// The values are defined in:
28
32
// - flutter/keyboard_maps.dart (kLinuxToPhysicalKey, kGtkToLogicalKey)
29
- static const std::map<int , int > kKeyCodeMap = {
33
+ const std::map<int , int > kKeyCodeMap = {
30
34
{0x00000009 , 65307 }, // LogicalKeyboardKey.escape
31
35
{0x0000000a , 49 }, // LogicalKeyboardKey.digit1
32
36
{0x0000000b , 50 }, // LogicalKeyboardKey.digit2
@@ -202,7 +206,7 @@ static const std::map<int, int> kKeyCodeMap = {
202
206
// The values are defined in:
203
207
// - efl/Ecore_Input.h
204
208
// - flutter/raw_keyboard_linux.dart (GtkKeyHelper)
205
- static const std::map<int , int > kModifierMap = {
209
+ const std::map<int , int > kModifierMap = {
206
210
{0x0001 , 1 << 0 }, // SHIFT (modifierShift)
207
211
{0x0002 , 1 << 2 }, // CTRL (modifierControl)
208
212
{0x0004 , 1 << 3 }, // ALT (modifierMod1)
@@ -212,12 +216,13 @@ static const std::map<int, int> kModifierMap = {
212
216
{0x0040 , 1 << 1 }, // CAPS (modifierCapsLock)
213
217
};
214
218
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 ())) {}
221
226
222
227
KeyEventChannel::~KeyEventChannel () {}
223
228
@@ -251,3 +256,5 @@ void KeyEventChannel::SendKeyEvent(Ecore_Event_Key* key, bool is_down) {
251
256
}
252
257
channel_->Send (event);
253
258
}
259
+
260
+ } // namespace flutter
0 commit comments