From 654e6be72abba45ec3f17717deb2f27be681ca30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 19 Apr 2024 23:10:08 +0200 Subject: [PATCH] clapper-app: Be more restrictive about key modifiers Ignore key presses with additional modifiers if we describe them in shortcuts as sole letters. Combinations might be needed in the future. --- src/bin/clapper-app/clapper-app-window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-window.c b/src/bin/clapper-app/clapper-app-window.c index 475b6b6a..d591e573 100644 --- a/src/bin/clapper-app/clapper-app-window.c +++ b/src/bin/clapper-app/clapper-app-window.c @@ -736,7 +736,7 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval, break; case GDK_KEY_space: case GDK_KEY_k: - if (!self->key_held) // Disable constant toggling when key held + if (!self->key_held && (state & GDK_MODIFIER_MASK) == 0) gtk_widget_activate_action (self->video, "video.toggle-play", NULL); break; case GDK_KEY_less: @@ -748,10 +748,11 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval, _handle_speed_key_press (self, TRUE); break; case GDK_KEY_m: - gtk_widget_activate_action (self->video, "video.toggle-mute", NULL); + if (!self->key_held && (state & GDK_MODIFIER_MASK) == 0) + gtk_widget_activate_action (self->video, "video.toggle-mute", NULL); break; case GDK_KEY_p: - if (!self->key_held) + if (!self->key_held && (state & GDK_MODIFIER_MASK) == 0) _handle_progression_key_press (self); break; default: