diff options
author | 2010-08-09 22:29:59 +0200 | |
---|---|---|
committer | 2010-08-09 22:29:59 +0200 | |
commit | e4b30f8f2bb944e05a44ca90237c4787a50118bf (patch) | |
tree | 8a009a07e381af5377c653a1cff0c3d61a6e43c0 /plugins/gtkui/callbacks.c | |
parent | eb1a7ba7241ecb2cb2b2d0c99b5981efd109aeea (diff) |
switch between playlists with keys 1-9 with and without alt(mod1) modifier
Diffstat (limited to 'plugins/gtkui/callbacks.c')
-rw-r--r-- | plugins/gtkui/callbacks.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 800b7489..1f1c817b 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -298,6 +298,13 @@ on_mainwin_key_press_event (GtkWidget *widget, // button for that one is not in toolbar anymore, so handle it manually deadbeef->sendmessage (M_PLAYRANDOM, 0, 0, 0); } + else if ((event->state == GDK_MOD1_MASK || event->state == 0) && event->keyval >= GDK_1 && event->keyval <= GDK_9) { + int pl = event->keyval - GDK_1; + if (pl >= 0 && pl < deadbeef->plt_get_count ()) { + deadbeef->plt_set_curr (pl); + deadbeef->conf_set_int ("playlist.current", pl); + } + } else { ddb_listview_handle_keypress (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), event->keyval, event->state); } |