Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
fl_keyboard_manager.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_LINUX_FL_KEYBOARD_MANAGER_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_KEYBOARD_MANAGER_H_
7
8#include <gdk/gdk.h>
9
10#include "flutter/shell/platform/linux/fl_keyboard_view_delegate.h"
11
12G_BEGIN_DECLS
13
14#define FL_TYPE_KEYBOARD_MANAGER fl_keyboard_manager_get_type()
16 fl_keyboard_manager,
17 FL,
18 KEYBOARD_MANAGER,
19 GObject);
20
21/**
22 * FlKeyboardManager:
23 *
24 * Processes keyboard events and cooperate with `TextInputPlugin`.
25 *
26 * A keyboard event goes through a few sections, each can choose to handle the
27 * event, and only unhandled events can move to the next section:
28 *
29 * - Keyboard: Dispatch to the embedder responder and the channel responder
30 * simultaneously. After both responders have responded (asynchronously), the
31 * event is considered handled if either responder handles it.
32 * - Text input: Events are sent to IM filter (usually owned by
33 * `TextInputPlugin`) and are handled synchronously.
34 * - Redispatching: Events are inserted back to the system for redispatching.
35 */
36
37/**
38 * fl_keyboard_manager_new:
39 * @view_delegate: An interface that the manager requires to communicate with
40 * the platform. Usually implemented by FlView.
41 *
42 * Create a new #FlKeyboardManager.
43 *
44 * Returns: a new #FlKeyboardManager.
45 */
47 FlBinaryMessenger* messenger,
48 FlKeyboardViewDelegate* view_delegate);
49
50/**
51 * fl_keyboard_manager_handle_event:
52 * @manager: the #FlKeyboardManager self.
53 * @event: the event to be dispatched. It is usually a wrap of a GdkEventKey.
54 * This event will be managed and released by #FlKeyboardManager.
55 *
56 * Make the manager process a system key event. This might eventually send
57 * messages to the framework, trigger text input effects, or redispatch the
58 * event back to the system.
59 */
62
63/**
64 * fl_keyboard_manager_is_state_clear:
65 * @manager: the #FlKeyboardManager self.
66 *
67 * A debug-only method that queries whether the manager's various states are
68 * cleared, i.e. no pending events for redispatching or for responding.
69 *
70 * Returns: true if the manager's various states are cleared.
71 */
73
74/**
75 * fl_keyboard_manager_sync_modifier_if_needed:
76 * @manager: the #FlKeyboardManager self.
77 * @state: the state of the modifiers mask.
78 * @event_time: the time attribute of the incoming GDK event.
79 *
80 * If needed, synthesize modifier keys up and down event by comparing their
81 * current pressing states with the given modifiers mask.
82 */
84 guint state,
85 double event_time);
86
87/**
88 * fl_keyboard_manager_get_pressed_state:
89 * @manager: the #FlKeyboardManager self.
90 *
91 * Returns the keyboard pressed state. The hash table contains one entry per
92 * pressed keys, mapping from the logical key to the physical key.*
93 */
95
96G_END_DECLS
97
98#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEYBOARD_MANAGER_H_
AtkStateType state
FlKeyEvent * event
typedefG_BEGIN_DECLS struct _FlKeyboardManager FlKeyboardManager
gboolean fl_keyboard_manager_handle_event(FlKeyboardManager *manager, FlKeyEvent *event)
gboolean fl_keyboard_manager_is_state_clear(FlKeyboardManager *manager)
G_DECLARE_FINAL_TYPE(FlKeyboardManager, fl_keyboard_manager, FL, KEYBOARD_MANAGER, GObject)
void fl_keyboard_manager_sync_modifier_if_needed(FlKeyboardManager *manager, guint state, double event_time)
GHashTable * fl_keyboard_manager_get_pressed_state(FlKeyboardManager *manager)
FlKeyboardManager * fl_keyboard_manager_new(FlBinaryMessenger *messenger, FlKeyboardViewDelegate *view_delegate)