menu_frame_select_next(frame);
ret = TRUE;
}
+
+ else if (ob_keycode_match(keycode, OB_KEY_HOME)) {
+ menu_frame_select_first(frame);
+ ret = TRUE;
+ }
+
+ else if (ob_keycode_match(keycode, OB_KEY_END)) {
+ menu_frame_select_last(frame);
+ ret = TRUE;
+ }
}
/* Use KeyRelease events for running things so that the key release doesn't
}
menu_frame_select(self, it ? it->data : NULL, FALSE);
}
+
+void menu_frame_select_first(ObMenuFrame *self)
+{
+ GList *it = NULL;
+
+ if (self->entries) {
+ for (it = self->entries; it; it = g_list_next(it)) {
+ ObMenuEntryFrame *e = it->data;
+ if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)
+ break;
+ if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL)
+ break;
+ }
+ }
+ menu_frame_select(self, it ? it->data : NULL, FALSE);
+}
+
+void menu_frame_select_last(ObMenuFrame *self)
+{
+ GList *it = NULL;
+
+ if (self->entries) {
+ for (it = g_list_last(self->entries); it; it = g_list_previous(it)) {
+ ObMenuEntryFrame *e = it->data;
+ if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)
+ break;
+ if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL)
+ break;
+ }
+ }
+ menu_frame_select(self, it ? it->data : NULL, FALSE);
+}
gboolean immediate);
void menu_frame_select_previous(ObMenuFrame *self);
void menu_frame_select_next(ObMenuFrame *self);
+void menu_frame_select_first(ObMenuFrame *self);
+void menu_frame_select_last(ObMenuFrame *self);
ObMenuFrame* menu_frame_under(gint x, gint y);
ObMenuEntryFrame* menu_entry_frame_under(gint x, gint y);
OB_KEY_DOWN,
OB_KEY_TAB,
OB_KEY_SPACE,
+ OB_KEY_HOME,
+ OB_KEY_END,
OB_NUM_KEYS
} ObKey;
keys[OB_KEY_DOWN] = modkeys_sym_to_code(XK_Down);
keys[OB_KEY_TAB] = modkeys_sym_to_code(XK_Tab);
keys[OB_KEY_SPACE] = modkeys_sym_to_code(XK_space);
+ keys[OB_KEY_HOME] = modkeys_sym_to_code(XK_Home);
+ keys[OB_KEY_END] = modkeys_sym_to_code(XK_End);
{
ObParseInst *i;
g_free(keys[OB_KEY_DOWN]);
g_free(keys[OB_KEY_TAB]);
g_free(keys[OB_KEY_SPACE]);
+ g_free(keys[OB_KEY_HOME]);
+ g_free(keys[OB_KEY_END]);
modkeys_shutdown(reconfigure);
} while (reconfigure);