From 075d0a7aa517cbee733762af0870a026b436ee56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=83=81=EC=9A=B1/Common=20Platform=20Lab=28SR?= =?UTF-8?q?=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 5 Oct 2020 13:02:19 +0900 Subject: [PATCH] Use camel case key for key event messages (#15) * Use camel case key for key event messages * Update DEPS file --- DEPS | 2 +- shell/platform/tizen/key_event_channel.cc | 24 +++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/DEPS b/DEPS index a5df10506651a..2227394f43456 100644 --- a/DEPS +++ b/DEPS @@ -106,7 +106,7 @@ allowed_hosts = [ deps = { 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'a6c0959d1ac8cdfe6f9ff87892bc4905a73699fe', - 'src/third_party/tizen_tools' :'git@github.sec.samsung.net:f-project/tizen_tools.git' + '@' + 'f2d2461da1c0a3192019c475c7210456cb8ec715', + 'src/third_party/tizen_tools' :'git@github.sec.samsung.net:f-project/tizen_tools.git' + '@' + 'dcd6fbaaa68da4225ab1482e60e6e6ee157664b6', # Fuchsia compatibility # diff --git a/shell/platform/tizen/key_event_channel.cc b/shell/platform/tizen/key_event_channel.cc index 5385d2fe9dee4..5700499f61532 100644 --- a/shell/platform/tizen/key_event_channel.cc +++ b/shell/platform/tizen/key_event_channel.cc @@ -24,8 +24,7 @@ static constexpr char kKeyMapKey[] = "keymap"; static constexpr char kKeyCodeKey[] = "keyCode"; static constexpr char kTypeKey[] = "type"; static constexpr char kModifiersKey[] = "modifiers"; -static constexpr char kKeynameKey[] = "keyname"; -static constexpr char kKeySymbolKey[] = "keysymbol"; +static constexpr char kKeyNameKey[] = "keyName"; static constexpr char kComposeKey[] = "compose"; static constexpr char kTizenKeyMap[] = "tizen"; static constexpr char kKeyUp[] = "keyup"; @@ -71,36 +70,31 @@ KeyEventChannel::~KeyEventChannel() { } void KeyEventChannel::OnKeyDown(Ecore_Event_Key* keyDownEvent) { - LoggerD("OnKeyDown##keycode == %d, keyname == %s", keyDownEvent->keycode, + LoggerD("OnKeyDown keyCode == %d, keyName == %s", keyDownEvent->keycode, keyDownEvent->keyname); rapidjson::Document event(rapidjson::kObjectType); auto& allocator = event.GetAllocator(); - rapidjson::Value keyName_code, key_code; + rapidjson::Value keyNameValue; event.AddMember(kKeyMapKey, kTizenKeyMap, allocator); event.AddMember(kTypeKey, kKeyDown, allocator); event.AddMember(kKeyCodeKey, keyDownEvent->keycode, allocator); event.AddMember(kModifiersKey, keyDownEvent->modifiers, allocator); - keyName_code.SetString(keyDownEvent->keyname, allocator); - event.AddMember(kKeynameKey, keyName_code, allocator); - key_code.SetString(keyDownEvent->keyname, allocator); - event.AddMember(kKeySymbolKey, key_code, allocator); + keyNameValue.SetString(keyDownEvent->keyname, allocator); + event.AddMember(kKeyNameKey, keyNameValue, allocator); channel_->Send(event); } void KeyEventChannel::OnKeyUp(Ecore_Event_Key* keyUpEvent) { - LoggerD("OnKeyUp##keycode == %d, keyname == %s", keyUpEvent->keycode, + LoggerD("OnKeyUp keyCode == %d, keyName == %s", keyUpEvent->keycode, keyUpEvent->keyname); rapidjson::Document event(rapidjson::kObjectType); auto& allocator = event.GetAllocator(); - rapidjson::Value keyName_code, key_code; + rapidjson::Value keyNameValue; event.AddMember(kKeyMapKey, kTizenKeyMap, allocator); event.AddMember(kTypeKey, kKeyUp, allocator); event.AddMember(kKeyCodeKey, keyUpEvent->keycode, allocator); event.AddMember(kModifiersKey, keyUpEvent->modifiers, allocator); - keyName_code.SetString(keyUpEvent->keyname, allocator); - event.AddMember(kKeynameKey, keyName_code, allocator); - key_code.SetString(keyUpEvent->keyname, allocator); - event.AddMember(kKeySymbolKey, key_code, allocator); - + keyNameValue.SetString(keyUpEvent->keyname, allocator); + event.AddMember(kKeyNameKey, keyNameValue, allocator); channel_->Send(event); }