38 GdkModifierType
state,
41 FL_KEY_EVENT(g_object_new(fl_key_event_get_type(),
nullptr));
44 self->is_press = is_press;
45 self->keycode = keycode;
46 self->keyval = keyval;
55 FL_KEY_EVENT(g_object_new(fl_key_event_get_type(),
nullptr));
57 GdkEventType
type = gdk_event_get_event_type(
event);
58 g_return_val_if_fail(
type == GDK_KEY_PRESS ||
type == GDK_KEY_RELEASE,
62 gdk_event_get_keycode(
event, &keycode);
64 gdk_event_get_keyval(
event, &keyval);
65 GdkModifierType
state =
static_cast<GdkModifierType
>(0);
68 self->time = gdk_event_get_time(
event);
69 self->is_press =
type == GDK_KEY_PRESS;
70 self->keycode = keycode;
71 self->keyval = keyval;
73 self->group =
event->key.group;
80 g_return_val_if_fail(FL_IS_KEY_EVENT(
self), 0);
85 g_return_val_if_fail(FL_IS_KEY_EVENT(
self), FALSE);
86 return self->is_press;
90 g_return_val_if_fail(FL_IS_KEY_EVENT(
self), 0);
95 g_return_val_if_fail(FL_IS_KEY_EVENT(
self), 0);
100 g_return_val_if_fail(FL_IS_KEY_EVENT(
self),
static_cast<GdkModifierType
>(0));
105 g_return_val_if_fail(FL_IS_KEY_EVENT(
self), 0);
110 g_return_val_if_fail(FL_IS_KEY_EVENT(
self),
nullptr);
115 g_return_val_if_fail(FL_IS_KEY_EVENT(
self), 0);
122 static_cast<uint64_t
>(
self->is_press ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
123 guint64 keycode =
static_cast<uint64_t
>(
self->keycode);
124 return (self->time & 0xffffffff) | ((
type & 0xffff) << 32) |
125 ((keycode & 0xffff) << 48);
129 FlKeyEvent*
self = FL_KEY_EVENT(
object);
131 g_clear_pointer(&self->origin, gdk_event_free);
133 G_OBJECT_CLASS(fl_key_event_parent_class)->dispose(
object);