Pike v8.1 release 6

Method GTK2.Widget()->keynav_failed()


Method keynav_failed

int keynav_failed(int direction)

Description

This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the "keynav-changed" signal on the widget and its return value should be interpreted in a way similar to the return value of widget->child_focus():

When TRUE is returned, stay in the widget, the failed keyboard navigation is Ok and/or there is nowhere we can/should move the focus to.

When FALSE is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling widget->child_focus() on the widget's toplevel.

The default ::keynav-failed handler returns TRUE for GTK_DIR.TAB_FORWARD and GTK_DIR.TAB_BACKWARD. For the other values of GtkDirectionType, it looks at the "gtk-keynav-cursor-only"" setting and returns FALSE if the setting is TRUE. This way the entire user interface becomes cursor-navigatable on input devices such as mobile phones which only have cursor keys but no tab key.

Whenever the default handler returns TRUE, it also calls widget->error_bell() to notify the user of the failed keyboard navigation.