summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes_callbacks.c
diff options
context:
space:
mode:
authorValentin Villenave <[email protected]>2021-10-07 13:18:09 +0200
committerraveit65 <[email protected]>2021-10-26 16:00:45 +0200
commitcf3bbe8ecb92548b6320d46d4a97197ab7bf6825 (patch)
tree1e665cc7b2f8e819affc6fe30ce05e87776ff271 /stickynotes/stickynotes_callbacks.c
parentce42d0f616999ef85a41b09024663ca9e5d2d18a (diff)
downloadmate-applets-cf3bbe8ecb92548b6320d46d4a97197ab7bf6825.tar.bz2
mate-applets-cf3bbe8ecb92548b6320d46d4a97197ab7bf6825.tar.xz
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.
Diffstat (limited to 'stickynotes/stickynotes_callbacks.c')
-rw-r--r--stickynotes/stickynotes_callbacks.c23
1 files changed, 23 insertions, 0 deletions
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,