summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-24 14:22:12 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-24 14:22:12 +0100
commit0e9e6e3d073c5b034568ba3c7f6f85e7197628cc (patch)
treef8b790391075ebe82e6941c71a72ff6cbe5dbd28 /plugins/gtkui
parentd03201c8933688dc078eef401cbccdff25657c35 (diff)
gtkui: added hotkeys for switching to playlist1-10; removed old play_random hardcoded hotkey
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/callbacks.c14
-rw-r--r--plugins/gtkui/gtkui.c10
2 files changed, 10 insertions, 14 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 24eeef9f..dae393a4 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -211,20 +211,6 @@ on_mainwin_key_press_event (GtkWidget *widget,
}
trace ("action not found\n");
- uint32_t maskedstate = (event->state &~ (GDK_LOCK_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK | GDK_MOD5_MASK)) & 0xfff;
- if ((maskedstate == GDK_MOD1_MASK || maskedstate == 0) && event->keyval == GDK_n) {
- // button for that one is not in toolbar anymore, so handle it manually
- deadbeef->sendmessage (DB_EV_PLAY_RANDOM, 0, 0, 0);
- return TRUE;
- }
- else if ((maskedstate == GDK_MOD1_MASK || maskedstate == 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_idx (pl);
- deadbeef->conf_set_int ("playlist.current", pl);
- }
- return TRUE;
- }
return FALSE;
}
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index adfb4869..f003be37 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -949,6 +949,16 @@ gtkui_thread (void *ctx) {
deadbeef->conf_set_str ("hotkey.key11", "\"Ctrl w\" 0 0 remove_current_playlist");
deadbeef->conf_set_str ("hotkey.key14", "\"Return\" 0 0 play");
deadbeef->conf_set_str ("hotkey.key15", "\"Ctrl p\" 0 0 toggle_pause");
+ deadbeef->conf_set_str ("hotkey.key16", "\"Alt 1\" 0 0 playlist1");
+ deadbeef->conf_set_str ("hotkey.key17", "\"Alt 2\" 0 0 playlist2");
+ deadbeef->conf_set_str ("hotkey.key18", "\"Alt 3\" 0 0 playlist3");
+ deadbeef->conf_set_str ("hotkey.key19", "\"Alt 4\" 0 0 playlist4");
+ deadbeef->conf_set_str ("hotkey.key20", "\"Alt 5\" 0 0 playlist5");
+ deadbeef->conf_set_str ("hotkey.key21", "\"Alt 6\" 0 0 playlist6");
+ deadbeef->conf_set_str ("hotkey.key22", "\"Alt 7\" 0 0 playlist7");
+ deadbeef->conf_set_str ("hotkey.key23", "\"Alt 8\" 0 0 playlist8");
+ deadbeef->conf_set_str ("hotkey.key24", "\"Alt 9\" 0 0 playlist9");
+ deadbeef->conf_set_str ("hotkey.key25", "\"Alt 0\" 0 0 playlist10");
}
// construct mainwindow widgets