Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
keyboard_key_channel_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_WINDOWS_KEYBOARD_KEY_CHANNEL_HANDLER_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_KEYBOARD_KEY_CHANNEL_HANDLER_H_
7
8#include <deque>
9#include <memory>
10#include <string>
11
12#include "flutter/fml/macros.h"
13#include "flutter/shell/platform/common/client_wrapper/include/flutter/basic_message_channel.h"
14#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
15#include "flutter/shell/platform/windows/keyboard_key_handler.h"
16#include "rapidjson/document.h"
17
18namespace flutter {
19
20// A delegate of |KeyboardKeyHandler| that handles events by sending the
21// raw information through the method channel.
22//
23// This class communicates with the RawKeyboard API in the framework.
26 public:
27 // Create a |KeyboardKeyChannelHandler| by specifying the messenger
28 // through which the events are sent.
30
32
33 // |KeyboardKeyHandler::KeyboardKeyHandlerDelegate|
34 void KeyboardHook(int key,
35 int scancode,
36 int action,
37 char32_t character,
38 bool extended,
39 bool was_down,
40 std::function<void(bool)> callback);
41
42 void SyncModifiersIfNeeded(int modifiers_state);
43
44 std::map<uint64_t, uint64_t> GetPressedState();
45
46 private:
47 // The Flutter system channel for key event messages.
48 std::unique_ptr<flutter::BasicMessageChannel<rapidjson::Document>> channel_;
49
51};
52
53} // namespace flutter
54
55#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_KEYBOARD_KEY_CHANNEL_HANDLER_H_
void KeyboardHook(int key, int scancode, int action, char32_t character, bool extended, bool was_down, std::function< void(bool)> callback)
std::map< uint64_t, uint64_t > GetPressedState()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27