From e1513b6b0094a3468e8a0dad7a0bace70dfeb79a Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Wed, 18 Jul 2018 18:40:39 +0200 Subject: [PATCH] clutter/x11: Detect auto-repeated key events Detect auto-repeated key events using the XIKeyRepeat flag. --- clutter/clutter/x11/clutter-device-manager-xi2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/clutter/x11/clutter-device-manager-xi2.c b/clutter/clutter/x11/clutter-device-manager-xi2.c index 62f558380..141f424b5 100644 --- a/clutter/clutter/x11/clutter-device-manager-xi2.c +++ b/clutter/clutter/x11/clutter-device-manager-xi2.c @@ -1271,6 +1271,9 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator, ? CLUTTER_KEY_PRESS : CLUTTER_KEY_RELEASE; + if (xev->evtype == XI_KeyPress && xev->flags & XIKeyRepeat) + clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_REPEATED); + event->key.time = xev->time; event->key.stage = stage; _clutter_input_device_xi2_translate_state (event, &xev->mods, &xev->buttons, &xev->group);