| Flutter Linux Embedder |

fl_key_event_channel.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_KEY_EVENT_CHANNEL_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_EVENT_CHANNEL_H_
7
8 #include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
9
10 G_BEGIN_DECLS
11
12 G_DECLARE_FINAL_TYPE(FlKeyEventChannel,
13 fl_key_event_channel,
14 FL,
15 KEY_EVENT_CHANNEL,
16 GObject);
17
18 /**
19 * FlKeyEventChannel:
20 *
21 * #FlKeyEventChannel is a channel that implements the shell side
22 * of SystemChannels.keyEvent from the Flutter services library.
23 */
24
25 typedef enum {
26 FL_KEY_EVENT_TYPE_KEYUP,
27 FL_KEY_EVENT_TYPE_KEYDOWN,
28 } FlKeyEventType;
29
30 /**
31 * fl_key_event_channel_new:
32 * @messenger: an #FlBinaryMessenger
33 *
34 * Creates a new channel that implements SystemChannels.keyEvent from the
35 * Flutter services library.
36 *
37 * Returns: a new #FlKeyEventChannel.
38 */
39 FlKeyEventChannel* fl_key_event_channel_new(FlBinaryMessenger* messenger);
40
41 /**
42 * fl_key_event_channel_send:
43 * @channel: an #FlKeyEventChannel
44 * @type: event type.
45 * @scan_code: scan code.
46 * @key_code: key code.
47 * @modifiers: modifiers.
48 * @unicode_scarlar_values:
49 * @specified_logical_key:
50 * @cancellable: (allow-none): a #GCancellable or %NULL.
51 * @callback: (scope async): a #GAsyncReadyCallback to call when the method
52 * returns.
53 * @user_data: (closure): user data to pass to @callback.
54 *
55 * Send a key event to the platform.
56 */
57 void fl_key_event_channel_send(FlKeyEventChannel* channel,
58 FlKeyEventType type,
59 int64_t scan_code,
60 int64_t key_code,
61 int64_t modifiers,
62 int64_t unicode_scarlar_values,
63 int64_t specified_logical_key,
64 GCancellable* cancellable,
65 GAsyncReadyCallback callback,
66 gpointer user_data);
67
68 /**
69 * fl_key_event_channel_send_finish:
70 * @object:
71 * @result: a #GAsyncResult.
72 * @error: (allow-none): #GError location to store the error occurring, or %NULL
73 * to ignore. If `error` is not %NULL, `*error` must be initialized (typically
74 * %NULL, but an error from a previous call using GLib error handling is
75 * explicitly valid).
76 *
77 * Completes request started with fl_key_event_channel_send().
78 *
79 * Returns: %TRUE on success.
80 */
81 gboolean fl_key_event_channel_send_finish(GObject* object,
82 GAsyncResult* result,
83 gboolean* handled,
84 GError** error);
85
86 G_END_DECLS
87
88 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_EVENT_CHANNEL_H_
user_data
const char FlTextDirection FlAssertiveness gpointer user_data
Definition: fl_accessibility_handler.cc:24
FL
FL
Definition: fl_binary_messenger.cc:27
fl_binary_messenger.h
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlKeyEventChannel, fl_key_event_channel, FL, KEY_EVENT_CHANNEL, GObject)
fl_key_event_channel_new
FlKeyEventChannel * fl_key_event_channel_new(FlBinaryMessenger *messenger)
Definition: fl_key_event_channel.cc:50
fl_key_event_channel_send_finish
gboolean fl_key_event_channel_send_finish(GObject *object, GAsyncResult *result, gboolean *handled, GError **error)
Definition: fl_key_event_channel.cc:108
FlKeyEventType
FlKeyEventType
Definition: fl_key_event_channel.h:25
FL_KEY_EVENT_TYPE_KEYDOWN
@ FL_KEY_EVENT_TYPE_KEYDOWN
Definition: fl_key_event_channel.h:27
FL_KEY_EVENT_TYPE_KEYUP
@ FL_KEY_EVENT_TYPE_KEYUP
Definition: fl_key_event_channel.h:26
fl_key_event_channel_send
void fl_key_event_channel_send(FlKeyEventChannel *channel, FlKeyEventType type, int64_t scan_code, int64_t key_code, int64_t modifiers, int64_t unicode_scarlar_values, int64_t specified_logical_key, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_key_event_channel.cc:63
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
type
uint8_t type
Definition: fl_standard_message_codec_test.cc:1117