[mutter] clutter/x11: Detect auto-repeated key events



commit e1513b6b0094a3468e8a0dad7a0bace70dfeb79a
Author: Andrea Azzarone <azzaronea gmail com>
Date:   Wed Jul 18 18:40:39 2018 +0200

    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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]