[gtk+] Forward repeated key presses as further down keys



commit 83471052cf1535c41370cfc8eead80e6899b3b51
Author: Andreas Pokorny <andreas pokorny canonical com>
Date:   Tue Jul 19 14:44:42 2016 +0200

    Forward repeated key presses as further down keys
    
    Signed-off-by: Andreas Pokorny <andreas pokorny canonical com>

 gdk/mir/gdkmireventsource.c |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)
---
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
index ce6af0a..910d389 100644
--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -290,28 +290,17 @@ handle_key_event (GdkWindow *window, const MirInputEvent *event)
   if (!keyboard_event)
     return;
 
-  switch (mir_keyboard_event_action (keyboard_event))
-    {
-    case mir_keyboard_action_up:
-    case mir_keyboard_action_down:
-      // FIXME: Convert keycode
-      _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
-      modifier_state = get_modifier_state (mir_keyboard_event_modifiers (keyboard_event), button_state);
-      keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
-
-      generate_key_event (window,
-                          mir_keyboard_event_action (keyboard_event) == mir_keyboard_action_down ? 
GDK_KEY_PRESS : GDK_KEY_RELEASE,
-                          modifier_state,
-                          mir_keyboard_event_key_code (keyboard_event),
-                          mir_keyboard_event_scan_code (keyboard_event),
-                          _gdk_mir_keymap_key_is_modifier (keymap, mir_keyboard_event_key_code 
(keyboard_event)),
-                          NANO_TO_MILLI (mir_input_event_get_event_time (event)));
-      break;
-    default:
-    //case mir_key_action_multiple:
-      // FIXME
-      break;
-    }
+  _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
+  modifier_state = get_modifier_state (mir_keyboard_event_modifiers (keyboard_event), button_state);
+  keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
+
+  generate_key_event (window,
+                      mir_keyboard_event_action (keyboard_event) == mir_keyboard_action_up ? GDK_KEY_RELEASE 
: GDK_KEY_PRESS,
+                      modifier_state,
+                      mir_keyboard_event_key_code (keyboard_event),
+                      mir_keyboard_event_scan_code (keyboard_event),
+                      _gdk_mir_keymap_key_is_modifier (keymap, mir_keyboard_event_key_code (keyboard_event)),
+                      NANO_TO_MILLI (mir_input_event_get_event_time (event)));
 }
 
 static void


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