From 14ad12b1dbcbaa4767d350d6c7cdda379d8b76df Mon Sep 17 00:00:00 2001 From: Francisco Magdaleno Date: Tue, 23 Oct 2018 09:15:32 -0700 Subject: [PATCH 1/4] [linux] Adds raw key events plugin. --- library/linux/src/embedder.cc | 9 ++- .../linux/src/internal/key_event_plugin.cc | 60 +++++++++++++++++++ library/linux/src/internal/key_event_plugin.h | 39 ++++++++++++ library/linux/src/json_method_codec.cc | 4 ++ 4 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 library/linux/src/internal/key_event_plugin.cc create mode 100644 library/linux/src/internal/key_event_plugin.h diff --git a/library/linux/src/embedder.cc b/library/linux/src/embedder.cc index 3bd1b4494..2bc7f99d2 100644 --- a/library/linux/src/embedder.cc +++ b/library/linux/src/embedder.cc @@ -26,6 +26,7 @@ #include +#include "library/linux/src/internal/key_event_plugin.h" #include "library/linux/src/internal/keyboard_hook_handler.h" #include "library/linux/src/internal/plugin_handler.h" #include "library/linux/src/internal/text_input_plugin.h" @@ -272,13 +273,17 @@ GLFWwindow *CreateFlutterWindow(size_t initial_width, size_t initial_height, FlutterEmbedderState *state = new FlutterEmbedderState(); state->plugin_handler = std::make_unique(engine); state->engine = engine; + + auto key_event_plugin = std::make_unique(); + state->keyboard_hook_handlers.push_back(key_event_plugin.get()); auto input_plugin = std::make_unique(); state->keyboard_hook_handlers.push_back(input_plugin.get()); - + glfwSetWindowUserPointer(window, state); + AddPlugin(window, std::move(key_event_plugin)); AddPlugin(window, std::move(input_plugin)); - + int width, height; glfwGetWindowSize(window, &width, &height); GLFWwindowSizeCallback(window, width, height); diff --git a/library/linux/src/internal/key_event_plugin.cc b/library/linux/src/internal/key_event_plugin.cc new file mode 100644 index 000000000..05485fc6f --- /dev/null +++ b/library/linux/src/internal/key_event_plugin.cc @@ -0,0 +1,60 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include "library/linux/src/internal/key_event_plugin.h" +#include +#include + +static constexpr char kChannelName[] = "flutter/keyevent"; + +static constexpr char kKeyCodeKey[] = "keyCode"; +static constexpr char kKeyMapKey[] = "keymap"; +static constexpr char kTypeKey[] = "type"; + +static constexpr char kAndroidKeyMap[] = "android"; +static constexpr char kKeyUp[] = "keyup"; +static constexpr char kKeyDown[] = "keydown"; +// TODO: This event is not supported by Flutter. Add once it's implemented. +static constexpr char kRepeat[] = "repeat"; + +namespace flutter_desktop_embedding { +KeyEventPlugin::KeyEventPlugin() : JsonPlugin(kChannelName, false) {} + +KeyEventPlugin::~KeyEventPlugin() {} + +void KeyEventPlugin::CharHook(GLFWwindow *window, unsigned int code_point) {} + +void KeyEventPlugin::KeyboardHook(GLFWwindow *window, int key, int scancode, + int action, int mods) { + Json::Value args; + args[kKeyCodeKey] = key; + args[kKeyMapKey] = kAndroidKeyMap; + switch (action) { + case GLFW_PRESS: + args[kTypeKey] = kKeyDown; + break; + case GLFW_RELEASE: + args[kTypeKey] = kKeyUp; + break; + default: + break; + } + /// Messages to flutter/keyevent channels have no method name. + InvokeMethod("", args); +} + +void KeyEventPlugin::HandleJsonMethodCall( + const JsonMethodCall &method_call, std::unique_ptr result) { + // There are no methods invoked from Flutter on this channel. + } +} // namespace flutter_desktop_embedding \ No newline at end of file diff --git a/library/linux/src/internal/key_event_plugin.h b/library/linux/src/internal/key_event_plugin.h new file mode 100644 index 000000000..0ab992f5a --- /dev/null +++ b/library/linux/src/internal/key_event_plugin.h @@ -0,0 +1,39 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_PLUGIN_H_ +#define LIBRARY_LINUX_SRC_INTERNAL_kEY_EVENT_PLUGIN_H_ + +#include "library/linux/include/flutter_desktop_embedding/json_plugin.h" +#include "library/linux/src/internal/keyboard_hook_handler.h" + +namespace flutter_desktop_embedding { +class KeyEventPlugin : public KeyboardHookHandler, public JsonPlugin { + public: + KeyEventPlugin(); + virtual ~KeyEventPlugin(); + + // Plugin. + void HandleJsonMethodCall(const JsonMethodCall &method_call, + std::unique_ptr result) override; + + // KeyboardHookHandler. + void KeyboardHook(GLFWwindow *window, int key, int scancode, int action, + int mods) override; + + // KeyboardHookHandler. + void CharHook(GLFWwindow *window, unsigned int code_point) override; +}; +} // namespace flutter_desktop_embedding + +#endif // LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_PLUGIN_H_ diff --git a/library/linux/src/json_method_codec.cc b/library/linux/src/json_method_codec.cc index 29107110f..b0e98b7b0 100644 --- a/library/linux/src/json_method_codec.cc +++ b/library/linux/src/json_method_codec.cc @@ -49,6 +49,10 @@ std::unique_ptr JsonMethodCodec::DecodeMethodCallInternal( std::unique_ptr> JsonMethodCodec::EncodeMethodCallInternal( const MethodCall &method_call) const { Json::Value message(Json::objectValue); + if (method_call.method_name().empty()) { + return EncodeJsonObject( + *static_cast(method_call.arguments())); + } message[kMessageMethodKey] = method_call.method_name(); message[kMessageArgumentsKey] = *static_cast(method_call.arguments()); From 5345b294f0e33cb9fa2d97e270a974840fa87965 Mon Sep 17 00:00:00 2001 From: Francisco Magdaleno Date: Mon, 3 Dec 2018 16:03:00 -0800 Subject: [PATCH 2/4] [linux] Adding BinaryMessenger --- library/linux/src/embedder.cc | 13 ++++++----- .../linux/src/internal/key_event_plugin.cc | 19 +++++++++------- library/linux/src/internal/key_event_plugin.h | 22 +++++++++++++------ library/linux/src/json_method_codec.cc | 4 ---- 4 files changed, 33 insertions(+), 25 deletions(-) diff --git a/library/linux/src/embedder.cc b/library/linux/src/embedder.cc index 2bc7f99d2..858608be4 100644 --- a/library/linux/src/embedder.cc +++ b/library/linux/src/embedder.cc @@ -51,6 +51,7 @@ struct FlutterEmbedderState { // deleted from the heap. std::vector keyboard_hook_handlers; + std::unique_ptr key_event_plugin; }; static constexpr char kDefaultWindowTitle[] = "Flutter"; @@ -273,17 +274,17 @@ GLFWwindow *CreateFlutterWindow(size_t initial_width, size_t initial_height, FlutterEmbedderState *state = new FlutterEmbedderState(); state->plugin_handler = std::make_unique(engine); state->engine = engine; - - auto key_event_plugin = std::make_unique(); - state->keyboard_hook_handlers.push_back(key_event_plugin.get()); + + state->key_event_plugin = std::make_unique(); + state->key_event_plugin->SetBinaryMessenger(state->plugin_handler.get()); + state->keyboard_hook_handlers.push_back(state->key_event_plugin.get()); auto input_plugin = std::make_unique(); state->keyboard_hook_handlers.push_back(input_plugin.get()); - + glfwSetWindowUserPointer(window, state); - AddPlugin(window, std::move(key_event_plugin)); AddPlugin(window, std::move(input_plugin)); - + int width, height; glfwGetWindowSize(window, &width, &height); GLFWwindowSizeCallback(window, width, height); diff --git a/library/linux/src/internal/key_event_plugin.cc b/library/linux/src/internal/key_event_plugin.cc index 05485fc6f..fdba0fee0 100644 --- a/library/linux/src/internal/key_event_plugin.cc +++ b/library/linux/src/internal/key_event_plugin.cc @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "library/linux/src/internal/key_event_plugin.h" +#include "library/linux/src/internal/json_message_codec.h" + #include +#include #include static constexpr char kChannelName[] = "flutter/keyevent"; @@ -28,10 +31,13 @@ static constexpr char kKeyDown[] = "keydown"; static constexpr char kRepeat[] = "repeat"; namespace flutter_desktop_embedding { -KeyEventPlugin::KeyEventPlugin() : JsonPlugin(kChannelName, false) {} - +KeyEventPlugin::KeyEventPlugin() : channel_(kChannelName) {} KeyEventPlugin::~KeyEventPlugin() {} +void KeyEventPlugin::SetBinaryMessenger(BinaryMessenger *messenger) { + messenger_ = messenger; +} + void KeyEventPlugin::CharHook(GLFWwindow *window, unsigned int code_point) {} void KeyEventPlugin::KeyboardHook(GLFWwindow *window, int key, int scancode, @@ -49,12 +55,9 @@ void KeyEventPlugin::KeyboardHook(GLFWwindow *window, int key, int scancode, default: break; } - /// Messages to flutter/keyevent channels have no method name. - InvokeMethod("", args); + + auto message = JsonMessageCodec::GetInstance().EncodeMessage(args); + messenger_->Send(channel_, message->data(), message->size()); } -void KeyEventPlugin::HandleJsonMethodCall( - const JsonMethodCall &method_call, std::unique_ptr result) { - // There are no methods invoked from Flutter on this channel. - } } // namespace flutter_desktop_embedding \ No newline at end of file diff --git a/library/linux/src/internal/key_event_plugin.h b/library/linux/src/internal/key_event_plugin.h index 0ab992f5a..68f779727 100644 --- a/library/linux/src/internal/key_event_plugin.h +++ b/library/linux/src/internal/key_event_plugin.h @@ -14,26 +14,34 @@ #ifndef LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_PLUGIN_H_ #define LIBRARY_LINUX_SRC_INTERNAL_kEY_EVENT_PLUGIN_H_ -#include "library/linux/include/flutter_desktop_embedding/json_plugin.h" +#include "library/linux/include/flutter_desktop_embedding/binary_messenger.h" + #include "library/linux/src/internal/keyboard_hook_handler.h" +#include + namespace flutter_desktop_embedding { -class KeyEventPlugin : public KeyboardHookHandler, public JsonPlugin { +class KeyEventPlugin : public KeyboardHookHandler { public: - KeyEventPlugin(); + explicit KeyEventPlugin(); virtual ~KeyEventPlugin(); - // Plugin. - void HandleJsonMethodCall(const JsonMethodCall &method_call, - std::unique_ptr result) override; - // KeyboardHookHandler. void KeyboardHook(GLFWwindow *window, int key, int scancode, int action, int mods) override; // KeyboardHookHandler. void CharHook(GLFWwindow *window, unsigned int code_point) override; + + // Binds this plugin to the given caller-owned binary messenger. It must + // remain valid for the life of the plugin. + void SetBinaryMessenger(BinaryMessenger *messenger); + + private: + const BinaryMessenger *messenger_; + std::string channel_; }; + } // namespace flutter_desktop_embedding #endif // LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_PLUGIN_H_ diff --git a/library/linux/src/json_method_codec.cc b/library/linux/src/json_method_codec.cc index b0e98b7b0..29107110f 100644 --- a/library/linux/src/json_method_codec.cc +++ b/library/linux/src/json_method_codec.cc @@ -49,10 +49,6 @@ std::unique_ptr JsonMethodCodec::DecodeMethodCallInternal( std::unique_ptr> JsonMethodCodec::EncodeMethodCallInternal( const MethodCall &method_call) const { Json::Value message(Json::objectValue); - if (method_call.method_name().empty()) { - return EncodeJsonObject( - *static_cast(method_call.arguments())); - } message[kMessageMethodKey] = method_call.method_name(); message[kMessageArgumentsKey] = *static_cast(method_call.arguments()); From 5b537ba77b8fbb381328b6952bad323190dd1602 Mon Sep 17 00:00:00 2001 From: Francisco Magdaleno Date: Wed, 5 Dec 2018 15:25:05 -0800 Subject: [PATCH 3/4] Rename KeyEventPlugin to KeyEventHandler --- library/linux/src/embedder.cc | 10 +++++----- ...{key_event_plugin.cc => key_event_handler.cc} | 16 +++++++++------- .../{key_event_plugin.h => key_event_handler.h} | 10 ++++++---- 3 files changed, 20 insertions(+), 16 deletions(-) rename library/linux/src/internal/{key_event_plugin.cc => key_event_handler.cc} (78%) rename library/linux/src/internal/{key_event_plugin.h => key_event_handler.h} (87%) diff --git a/library/linux/src/embedder.cc b/library/linux/src/embedder.cc index 858608be4..d59211f48 100644 --- a/library/linux/src/embedder.cc +++ b/library/linux/src/embedder.cc @@ -26,7 +26,7 @@ #include -#include "library/linux/src/internal/key_event_plugin.h" +#include "library/linux/src/internal/key_event_handler.h" #include "library/linux/src/internal/keyboard_hook_handler.h" #include "library/linux/src/internal/plugin_handler.h" #include "library/linux/src/internal/text_input_plugin.h" @@ -51,7 +51,7 @@ struct FlutterEmbedderState { // deleted from the heap. std::vector keyboard_hook_handlers; - std::unique_ptr key_event_plugin; + std::unique_ptr key_event_handler; }; static constexpr char kDefaultWindowTitle[] = "Flutter"; @@ -275,9 +275,9 @@ GLFWwindow *CreateFlutterWindow(size_t initial_width, size_t initial_height, state->plugin_handler = std::make_unique(engine); state->engine = engine; - state->key_event_plugin = std::make_unique(); - state->key_event_plugin->SetBinaryMessenger(state->plugin_handler.get()); - state->keyboard_hook_handlers.push_back(state->key_event_plugin.get()); + state->key_event_handler = std::make_unique(); + state->key_event_handler->SetBinaryMessenger(state->plugin_handler.get()); + state->keyboard_hook_handlers.push_back(state->key_event_handler.get()); auto input_plugin = std::make_unique(); state->keyboard_hook_handlers.push_back(input_plugin.get()); diff --git a/library/linux/src/internal/key_event_plugin.cc b/library/linux/src/internal/key_event_handler.cc similarity index 78% rename from library/linux/src/internal/key_event_plugin.cc rename to library/linux/src/internal/key_event_handler.cc index fdba0fee0..6c8e1a714 100644 --- a/library/linux/src/internal/key_event_plugin.cc +++ b/library/linux/src/internal/key_event_handler.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "library/linux/src/internal/key_event_plugin.h" +#include "library/linux/src/internal/key_event_handler.h" #include "library/linux/src/internal/json_message_codec.h" #include @@ -31,20 +31,23 @@ static constexpr char kKeyDown[] = "keydown"; static constexpr char kRepeat[] = "repeat"; namespace flutter_desktop_embedding { -KeyEventPlugin::KeyEventPlugin() : channel_(kChannelName) {} -KeyEventPlugin::~KeyEventPlugin() {} +KeyEventHandler::KeyEventHandler() : channel_(kChannelName) {} +KeyEventHandler::~KeyEventHandler() {} -void KeyEventPlugin::SetBinaryMessenger(BinaryMessenger *messenger) { +void KeyEventHandler::SetBinaryMessenger(BinaryMessenger *messenger) { messenger_ = messenger; } -void KeyEventPlugin::CharHook(GLFWwindow *window, unsigned int code_point) {} +void KeyEventHandler::CharHook(GLFWwindow *window, unsigned int code_point) {} -void KeyEventPlugin::KeyboardHook(GLFWwindow *window, int key, int scancode, +void KeyEventHandler::KeyboardHook(GLFWwindow *window, int key, int scancode, int action, int mods) { + // TODO: Translate to a cross-platform key code system rather than passing + // the native key code. Json::Value args; args[kKeyCodeKey] = key; args[kKeyMapKey] = kAndroidKeyMap; + switch (action) { case GLFW_PRESS: args[kTypeKey] = kKeyDown; @@ -55,7 +58,6 @@ void KeyEventPlugin::KeyboardHook(GLFWwindow *window, int key, int scancode, default: break; } - auto message = JsonMessageCodec::GetInstance().EncodeMessage(args); messenger_->Send(channel_, message->data(), message->size()); } diff --git a/library/linux/src/internal/key_event_plugin.h b/library/linux/src/internal/key_event_handler.h similarity index 87% rename from library/linux/src/internal/key_event_plugin.h rename to library/linux/src/internal/key_event_handler.h index 68f779727..1d69d8f4a 100644 --- a/library/linux/src/internal/key_event_plugin.h +++ b/library/linux/src/internal/key_event_handler.h @@ -15,16 +15,18 @@ #define LIBRARY_LINUX_SRC_INTERNAL_kEY_EVENT_PLUGIN_H_ #include "library/linux/include/flutter_desktop_embedding/binary_messenger.h" - #include "library/linux/src/internal/keyboard_hook_handler.h" #include namespace flutter_desktop_embedding { -class KeyEventPlugin : public KeyboardHookHandler { +// Implements a KeyboardHookHandler +// +// Handles key events and forwards them to the Flutter engine. +class KeyEventHandler : public KeyboardHookHandler { public: - explicit KeyEventPlugin(); - virtual ~KeyEventPlugin(); + explicit KeyEventHandler(); + virtual ~KeyEventHandler(); // KeyboardHookHandler. void KeyboardHook(GLFWwindow *window, int key, int scancode, int action, From 8a0a72efe18dccb18e50f358c9f1d97300f9da97 Mon Sep 17 00:00:00 2001 From: Francisco Magdaleno Date: Thu, 6 Dec 2018 11:28:44 -0800 Subject: [PATCH 4/4] Address review comments (documentation, alignment, constructor parameters) --- library/linux/src/embedder.cc | 7 +++++-- .../linux/src/internal/key_event_handler.cc | 18 +++++++++--------- library/linux/src/internal/key_event_handler.h | 17 ++++++----------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/library/linux/src/embedder.cc b/library/linux/src/embedder.cc index d59211f48..5ce1396e8 100644 --- a/library/linux/src/embedder.cc +++ b/library/linux/src/embedder.cc @@ -51,6 +51,9 @@ struct FlutterEmbedderState { // deleted from the heap. std::vector keyboard_hook_handlers; + // Handles raw key interactions from GLFW. + // TODO: Move key_event_handler once + // https://github.com/google/flutter-desktop-embedding/issues/102 is resolved. std::unique_ptr key_event_handler; }; @@ -275,8 +278,8 @@ GLFWwindow *CreateFlutterWindow(size_t initial_width, size_t initial_height, state->plugin_handler = std::make_unique(engine); state->engine = engine; - state->key_event_handler = std::make_unique(); - state->key_event_handler->SetBinaryMessenger(state->plugin_handler.get()); + state->key_event_handler = + std::make_unique(state->plugin_handler.get()); state->keyboard_hook_handlers.push_back(state->key_event_handler.get()); auto input_plugin = std::make_unique(); state->keyboard_hook_handlers.push_back(input_plugin.get()); diff --git a/library/linux/src/internal/key_event_handler.cc b/library/linux/src/internal/key_event_handler.cc index 6c8e1a714..1013a585b 100644 --- a/library/linux/src/internal/key_event_handler.cc +++ b/library/linux/src/internal/key_event_handler.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "library/linux/src/internal/key_event_handler.h" -#include "library/linux/src/internal/json_message_codec.h" -#include #include #include +#include "library/linux/src/internal/json_message_codec.h" + static constexpr char kChannelName[] = "flutter/keyevent"; static constexpr char kKeyCodeKey[] = "keyCode"; @@ -31,17 +31,16 @@ static constexpr char kKeyDown[] = "keydown"; static constexpr char kRepeat[] = "repeat"; namespace flutter_desktop_embedding { -KeyEventHandler::KeyEventHandler() : channel_(kChannelName) {} -KeyEventHandler::~KeyEventHandler() {} -void KeyEventHandler::SetBinaryMessenger(BinaryMessenger *messenger) { - messenger_ = messenger; -} +KeyEventHandler::KeyEventHandler(const BinaryMessenger *messenger) + : messenger_(messenger), channel_(kChannelName) {} + +KeyEventHandler::~KeyEventHandler() {} void KeyEventHandler::CharHook(GLFWwindow *window, unsigned int code_point) {} void KeyEventHandler::KeyboardHook(GLFWwindow *window, int key, int scancode, - int action, int mods) { + int action, int mods) { // TODO: Translate to a cross-platform key code system rather than passing // the native key code. Json::Value args; @@ -56,7 +55,8 @@ void KeyEventHandler::KeyboardHook(GLFWwindow *window, int key, int scancode, args[kTypeKey] = kKeyUp; break; default: - break; + std::cerr << "Unknown key event action: " << action << std::endl; + return; } auto message = JsonMessageCodec::GetInstance().EncodeMessage(args); messenger_->Send(channel_, message->data(), message->size()); diff --git a/library/linux/src/internal/key_event_handler.h b/library/linux/src/internal/key_event_handler.h index 1d69d8f4a..203917239 100644 --- a/library/linux/src/internal/key_event_handler.h +++ b/library/linux/src/internal/key_event_handler.h @@ -11,39 +11,34 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#ifndef LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_PLUGIN_H_ -#define LIBRARY_LINUX_SRC_INTERNAL_kEY_EVENT_PLUGIN_H_ +#ifndef LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_HANDLER_H_ +#define LIBRARY_LINUX_SRC_INTERNAL_kEY_EVENT_HANDLER_H_ #include "library/linux/include/flutter_desktop_embedding/binary_messenger.h" #include "library/linux/src/internal/keyboard_hook_handler.h" -#include - namespace flutter_desktop_embedding { + // Implements a KeyboardHookHandler // // Handles key events and forwards them to the Flutter engine. class KeyEventHandler : public KeyboardHookHandler { public: - explicit KeyEventHandler(); + explicit KeyEventHandler(const BinaryMessenger *messenger); virtual ~KeyEventHandler(); // KeyboardHookHandler. void KeyboardHook(GLFWwindow *window, int key, int scancode, int action, int mods) override; - - // KeyboardHookHandler. void CharHook(GLFWwindow *window, unsigned int code_point) override; + private: // Binds this plugin to the given caller-owned binary messenger. It must // remain valid for the life of the plugin. - void SetBinaryMessenger(BinaryMessenger *messenger); - - private: const BinaryMessenger *messenger_; std::string channel_; }; } // namespace flutter_desktop_embedding -#endif // LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_PLUGIN_H_ +#endif // LIBRARY_LINUX_SRC_INTERNAL_KEY_EVENT_HANDLER_H_