Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
glfw
key_event_handler.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_SHELL_PLATFORM_GLFW_KEY_EVENT_HANDLER_H_
6
#define FLUTTER_SHELL_PLATFORM_GLFW_KEY_EVENT_HANDLER_H_
7
8
#include <memory>
9
10
#include "flutter/shell/platform/common/client_wrapper/include/flutter/basic_message_channel.h"
11
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
12
#include "flutter/shell/platform/glfw/keyboard_hook_handler.h"
13
#include "flutter/shell/platform/glfw/public/flutter_glfw.h"
14
#include "rapidjson/document.h"
15
16
namespace
flutter
{
17
18
// Implements a KeyboardHookHandler
19
//
20
// Handles key events and forwards them to the Flutter engine.
21
class
KeyEventHandler
:
public
KeyboardHookHandler
{
22
public
:
23
explicit
KeyEventHandler
(
flutter::BinaryMessenger
* messenger);
24
25
virtual
~KeyEventHandler
();
26
27
// |KeyboardHookHandler|
28
void
KeyboardHook
(GLFWwindow*
window
,
29
int
key
,
30
int
scancode
,
31
int
action
,
32
int
mods)
override
;
33
34
// |KeyboardHookHandler|
35
void
CharHook
(GLFWwindow*
window
,
unsigned
int
code_point)
override
;
36
37
private
:
38
// The Flutter system channel for key event messages.
39
std::unique_ptr<flutter::BasicMessageChannel<rapidjson::Document>> channel_;
40
};
41
42
}
// namespace flutter
43
44
#endif
// FLUTTER_SHELL_PLATFORM_GLFW_KEY_EVENT_HANDLER_H_
flutter::BinaryMessenger
Definition
binary_messenger.h:28
flutter::KeyEventHandler
Definition
key_event_handler.h:21
flutter::KeyEventHandler::~KeyEventHandler
virtual ~KeyEventHandler()
flutter::KeyEventHandler::CharHook
void CharHook(GLFWwindow *window, unsigned int code_point) override
Definition
key_event_handler.cc:113
flutter::KeyEventHandler::KeyboardHook
void KeyboardHook(GLFWwindow *window, int key, int scancode, int action, int mods) override
Definition
key_event_handler.cc:115
flutter::KeyboardHookHandler
Definition
keyboard_hook_handler.h:15
window
GLFWwindow * window
Definition
main.cc:45
key
int key
Definition
keyboard_key_handler_unittests.cc:114
action
int action
Definition
keyboard_key_handler_unittests.cc:116
scancode
int scancode
Definition
keyboard_key_handler_unittests.cc:115
flutter
Definition
asset_manager.cc:10
Generated on Fri Apr 26 2024 06:14:30 for Flutter Engine by
1.9.8