commit 07fc0b0f0fae6b256a0eb95da8365acce4ac4f53 parent 9e62fd2d63f578de33e2604d1fb239b0c423a140 Author: cfillion <cfillion@users.noreply.github.com> Date: Sun, 5 Jun 2016 16:10:57 -0400 browser: implement Ctrl+A and Ctrl+Shift+A shortcuts Diffstat:
M | src/browser.cpp | | | 15 | +++++++++++---- |
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/browser.cpp b/src/browser.cpp @@ -191,18 +191,25 @@ void Browser::onCommand(const int id, const int event) bool Browser::onKeyDown(const int key, const int mods) { - if(GetFocus() == m_list->handle() && mods & MOD_CONTROL && key == 'C') { + if(GetFocus() != m_list->handle()) + return false; + + if(mods == MOD_CONTROL && key == 'A') + m_list->selectAll(); + else if(mods == (MOD_CONTROL | MOD_SHIFT) && key == 'A') + m_list->unselectAll(); + else if(mods == MOD_CONTROL && key == 'C') { vector<string> values; for(const int index : m_list->selection(false)) values.push_back(getValue(NameColumn, *getEntry(index))); setClipboard(values); - - return true; } + else + return false; - return false; + return true; } void Browser::onTimer(const int id)