diff --git a/gui/queue/window.cpp b/gui/queue/window.cpp index c38e68d7..576316cc 100644 --- a/gui/queue/window.cpp +++ b/gui/queue/window.cpp @@ -27,6 +27,8 @@ void QueueWindow :: init(Queue *queue) q_treeview->signal_row_activated().connect(sigc::mem_fun(*this, &QueueWindow :: on_row_activated)); + q_treeview->signal_key_press_event().connect(sigc::mem_fun(*this, + &QueueWindow :: on_key_press), false); q_treeview->set_model(q_filter); } @@ -49,6 +51,14 @@ bool QueueWindow :: filter_ids(const Gtk::TreeIter &iter) return set_has(&_q_search_res, _queue->operator[](id)->dbe_index); } +bool QueueWindow :: on_key_press(GdkEventKey *event) +{ + std::string key = gdk_keyval_name(event->keyval); + if (key == "space") + return true; + return false; +} + void QueueWindow :: on_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *col) { diff --git a/include/gui/queue/window.h b/include/gui/queue/window.h index 2a255d47..d2f20004 100644 --- a/include/gui/queue/window.h +++ b/include/gui/queue/window.h @@ -30,6 +30,7 @@ public: void filter(std::string &); bool filter_ids(const Gtk::TreeIter &); + bool on_key_press(GdkEventKey *); void on_row_activated(const Gtk::TreePath &, Gtk::TreeViewColumn *); };