summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-27 16:43:04 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-27 16:43:04 +0100
commit0b38c072a5e53d0af27a208a3b561034a2345506 (patch)
treeb3243b4c607048774e647d898ca761cc6ed6cb5c /plugins
parent1522d68ba866d47e0d9c12bc4df28d7e71407705 (diff)
keyboard navigation in search window
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/callbacks.c9
-rw-r--r--plugins/gtkui/gtkplaylist.c6
-rw-r--r--plugins/gtkui/search.c3
3 files changed, 12 insertions, 6 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 8be9021f..8d82b8c4 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -611,7 +611,14 @@ on_mainwin_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
- gtkpl_keypress (&main_playlist, event->keyval, event->state);
+
+ if (event->keyval == GDK_n) {
+ // button for that one is not in toolbar anymore, so handle it manually
+ deadbeef->sendmessage (M_PLAYRANDOM, 0, 0, 0);
+ }
+ else {
+ gtkpl_keypress (&main_playlist, event->keyval, event->state);
+ }
return FALSE;
}
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index 4a112107..bf2a6e18 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -891,11 +891,7 @@ gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) {
GtkWidget *range = ps->scrollbar;
int prev = deadbeef->pl_get_cursor (ps->iterator);
int newscroll = ps->scrollpos;
- if (keyval == GDK_n) {
- // button for that one is not in toolbar anymore, so handle it manually
- deadbeef->sendmessage (M_PLAYRANDOM, 0, 0, 0);
- }
- else if (keyval == GDK_Down) {
+ if (keyval == GDK_Down) {
int cursor = deadbeef->pl_get_cursor (ps->iterator);
if (cursor < ps->get_count () - 1) {
gtkpl_set_cursor (ps->iterator, cursor+1);
diff --git a/plugins/gtkui/search.c b/plugins/gtkui/search.c
index 07629f71..55b5ad3f 100644
--- a/plugins/gtkui/search.c
+++ b/plugins/gtkui/search.c
@@ -168,6 +168,9 @@ on_searchwin_key_press_event (GtkWidget *widget,
}
}
}
+ else {
+ gtkpl_keypress (&search_playlist, event->keyval, event->state);
+ }
return FALSE;
}