Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
fl_key_event.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_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_EVENT_H_
7
8#include <gdk/gdk.h>
9
10/**
11 * FlKeyEvent:
12 * A struct that stores information from GdkEvent.
13 *
14 * This is a class only used within the GTK embedding, created by
15 * FlView and consumed by FlKeyboardManager. It is not sent to
16 * the embedder.
17 *
18 * This object contains information from GdkEvent as well as an origin event
19 * object, so that Flutter can create an event object in unit tests even after
20 * migrating to GDK 4.0 which stops supporting creating GdkEvent.
21 */
22typedef struct _FlKeyEvent {
23 // Time in milliseconds.
24 guint32 time;
25 // True if is a press event, otherwise a release event.
27 // Hardware keycode.
28 guint16 keycode;
29 // Keyval.
30 guint keyval;
31 // Modifier state.
32 GdkModifierType state;
33 // Keyboard group.
34 guint8 group;
35 // The original event.
36 GdkEvent* origin;
38
39/**
40 * fl_key_event_new_from_gdk_event:
41 * @event: the #GdkEvent this #FlKeyEvent is based on. The #event must be a
42 * #GdkEventKey, and will be destroyed by #fl_key_event_dispose.
43 *
44 * Create a new #FlKeyEvent based on a #GdkEvent.
45 *
46 * Returns: a new #FlKeyEvent. Must be freed with #fl_key_event_dispose.
47 */
49
50/**
51 * fl_key_event_dispose:
52 * @event: the event to dispose.
53 *
54 * Properly disposes the content of #event and then the pointer.
55 */
57
59
60#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_EVENT_H_
SkBitmap source
Definition examples.cpp:28
FlKeyEvent * event
void fl_key_event_dispose(FlKeyEvent *event)
struct _FlKeyEvent FlKeyEvent
FlKeyEvent * fl_key_event_new_from_gdk_event(GdkEvent *event)
FlKeyEvent * fl_key_event_clone(const FlKeyEvent *source)
guint32 time
GdkEvent * origin
GdkModifierType state
guint16 keycode