From f7465771b057c0cd66eeb4290a05d87013200af3 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 6 May 2015 18:11:29 -0300 Subject: [PATCH] Add Ctrl+A (or Cmd+A) to select the whole text in ui::Entry --- src/ui/entry.cpp | 5 +++++ src/ui/entry.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ui/entry.cpp b/src/ui/entry.cpp index 416a7143b..cbd5ff995 100644 --- a/src/ui/entry.cpp +++ b/src/ui/entry.cpp @@ -277,6 +277,7 @@ bool Entry::onProcessMessage(Message* msg) case kKeyX: cmd = EntryCmd::Cut; break; case kKeyC: cmd = EntryCmd::Copy; break; case kKeyV: cmd = EntryCmd::Paste; break; + case kKeyA: cmd = EntryCmd::SelectAll; break; } } else if (getManager()->isFocusMovementKey(msg)) { @@ -653,6 +654,10 @@ void Entry::executeCmd(EntryCmd cmd, int unicodeChar, bool shift_pressed) m_select = -1; break; + + case EntryCmd::SelectAll: + selectAllText(); + break; } std::string newText = base::to_utf8(text); diff --git a/src/ui/entry.h b/src/ui/entry.h index c43acbf4a..71d9e5283 100644 --- a/src/ui/entry.h +++ b/src/ui/entry.h @@ -70,6 +70,7 @@ namespace ui { Cut, Copy, Paste, + SelectAll, }; int getCaretFromMouse(MouseMessage* mousemsg);