13
0

add key forwarding to playlist selector dialog

This commit is contained in:
Paul Davis 2021-06-06 08:06:11 -06:00
parent 2e0fa8943a
commit b03c8e7849
2 changed files with 21 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#include "playlist_selector.h"
#include "route_ui.h"
#include "gui_thread.h"
#include "utils.h"
#include "pbd/i18n.h"
@ -362,3 +363,22 @@ PlaylistSelector::selection_changed ()
}
}
}
bool
PlaylistSelector::on_key_press_event (GdkEventKey* ev)
{
/* Allow these keys to have their in-dialog effect */
switch (ev->keyval) {
case GDK_Up:
case GDK_Down:
case GDK_Return:
case GDK_KP_Enter:
return ArdourDialog::on_key_press_event (ev);
}
/* Don't just forward the key press ... make it act as if it occured in
whatever the main window currently is.
*/
return ARDOUR_UI_UTILS::emulate_key_event (ev->keyval, ev->state);
}

View File

@ -71,6 +71,7 @@ public:
protected:
bool on_unmap_event (GdkEventAny*);
bool on_key_press_event (GdkEventKey*);
private:
typedef std::map<PBD::ID,std::vector<boost::shared_ptr<ARDOUR::Playlist> >*> TrackPlaylistMap;