reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 586e9d82a81fe2e5384e706ef788f878165e12c6
parent 39a9621dad5a11eac79ebbd7d450ab422460c9e0
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun,  5 Jun 2016 16:03:46 -0400

manager: implement Ctrl+C shortcut for copying URL of selected remotes

Diffstat:
Msrc/manager.cpp | 16++++++++++++++++
Msrc/manager.hpp | 1+
2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/manager.cpp b/src/manager.cpp @@ -173,6 +173,22 @@ void Manager::onContextMenu(HWND target, const int x, const int y) menu.show(x, y, handle()); } +bool Manager::onKeyDown(const int key, const int mods) +{ + if(GetFocus() == m_list->handle() && mods & MOD_CONTROL && key == 'C') { + vector<string> values; + + for(const int index : m_list->selection(false)) + values.push_back(getRemote(index).url()); + + setClipboard(values); + + return true; + } + + return false; +} + void Manager::refresh() { InhibitControl lock(m_list); diff --git a/src/manager.hpp b/src/manager.hpp @@ -40,6 +40,7 @@ protected: void onInit() override; void onCommand(int, int) override; void onContextMenu(HWND, int x, int y) override; + bool onKeyDown(int, int) override; private: ListView::Row makeRow(const Remote &) const;