[totem/wip/hadess/fix-shortcuts: 7/7] main: Make Alt+Right/Alt+Left work
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/fix-shortcuts: 7/7] main: Make Alt+Right/Alt+Left work
- Date: Fri, 21 Aug 2020 23:37:23 +0000 (UTC)
commit d360d50f9d02d934808f67608115dfd07a8776e5
Author: Bastien Nocera <hadess hadess net>
Date: Sat Aug 22 01:34:47 2020 +0200
main: Make Alt+Right/Alt+Left work
src/totem-object.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index a0a2ef71e..2cc2fe018 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3400,6 +3400,19 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
break;
case GDK_KEY_Left:
case GDK_KEY_Right:
+ if (event->state & GDK_MOD1_MASK) {
+ gboolean is_forward;
+
+ is_forward = (event->keyval == GDK_KEY_Right);
+ /* Switch direction in RTL environment */
+ if (gtk_widget_get_direction (totem->win) == GTK_TEXT_DIR_RTL)
+ is_forward = !is_forward;
+ if (is_forward)
+ totem_object_seek_next (totem);
+ else
+ totem_object_seek_previous (totem);
+ break;
+ }
switch_rtl = TRUE;
/* fall through */
case GDK_KEY_Page_Up:
@@ -3623,6 +3636,18 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
}
}
+ if (event->state != 0 && (event->state & GDK_MOD1_MASK)) {
+ switch (event->keyval) {
+ case GDK_KEY_Left:
+ case GDK_KEY_Right:
+ if (event->type == GDK_KEY_PRESS)
+ return totem_object_handle_key_press (totem, event);
+ default:
+ break;
+ }
+
+ }
+
/* If we have modifiers, and either Ctrl, Mod1 (Alt), or any
* of Mod3 to Mod5 (Mod2 is num-lock...) are pressed, we
* let Gtk+ handle the key */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]