From 7af48f81bb1b2f88d1c1c56241b60161fffe68f1 Mon Sep 17 00:00:00 2001 From: Valentin Villenave Date: Thu, 7 Oct 2021 13:18:09 +0200 Subject: Mate Sticky notes applet: enable keyboard navigation through F6 As Tab and Shift-Tab get interpreted as indent/unindent, there was no way of leaving the text area through keyboard only. --- stickynotes/stickynotes_callbacks.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'stickynotes/stickynotes_callbacks.c') diff --git a/stickynotes/stickynotes_callbacks.c b/stickynotes/stickynotes_callbacks.c index 1d416f0f..b80f34e4 100644 --- a/stickynotes/stickynotes_callbacks.c +++ b/stickynotes/stickynotes_callbacks.c @@ -122,6 +122,29 @@ stickynote_show_popup_menu (GtkWidget *widget, return FALSE; } +/* Sticky Window Callback : Exit entry field on key press. */ +gboolean +stickynote_keypress_cb (GtkWidget *widget, + GdkEventKey *event, + StickyNote *note) +{ + GdkModifierType state = event->state & gtk_accelerator_get_default_mod_mask (); + + switch (event->keyval) { + case GDK_KEY_F6: + if (state == 0) + gtk_widget_child_focus(widget, GTK_DIR_TAB_FORWARD); + else if (state == GDK_SHIFT_MASK) + gtk_widget_child_focus(widget, GTK_DIR_TAB_BACKWARD); + else + break; + return TRUE; + default: + break; + } + + return FALSE; +} /* Popup Menu Callback : Create a new sticky note */ void popup_create_cb (GtkWidget *widget, -- cgit v1.2.1