diff options
author | crupest <crupest@outlook.com> | 2021-11-16 22:21:48 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-11-16 22:21:48 +0800 |
commit | ce1a7264a3325ae56e341d7af22b0fee914f213b (patch) | |
tree | 391cff09e33137f2483c6a7b35cde22a79895f7b /src/ui/controls/TextHostControlService.cpp | |
parent | f61cd0575f9f8b7be154073304795c22b0ec26ab (diff) | |
download | cru-ce1a7264a3325ae56e341d7af22b0fee914f213b.tar.gz cru-ce1a7264a3325ae56e341d7af22b0fee914f213b.tar.bz2 cru-ce1a7264a3325ae56e341d7af22b0fee914f213b.zip |
...
Diffstat (limited to 'src/ui/controls/TextHostControlService.cpp')
-rw-r--r-- | src/ui/controls/TextHostControlService.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/controls/TextHostControlService.cpp b/src/ui/controls/TextHostControlService.cpp index e3d25f14..3fb10a95 100644 --- a/src/ui/controls/TextHostControlService.cpp +++ b/src/ui/controls/TextHostControlService.cpp @@ -82,6 +82,16 @@ TextControlMovePattern TextControlMovePattern::kEnd( return Utf16ForwardUntil(text, current_position, [](char16_t c) { return c == u'\n'; }); }); +TextControlMovePattern TextControlMovePattern::kCtrlHome( + helper::ShortcutKeyBind(platform::gui::KeyCode::Home, + platform::gui::KeyModifiers::ctrl), + [](TextHostControlService* service, StringView text, + gsl::index current_position) { return 0; }); +TextControlMovePattern TextControlMovePattern::kCtrlEnd( + helper::ShortcutKeyBind(platform::gui::KeyCode::End, + platform::gui::KeyModifiers::ctrl), + [](TextHostControlService* service, StringView text, + gsl::index current_position) { return text.size(); }); TextControlMovePattern TextControlMovePattern::kPageUp( helper::ShortcutKeyBind(platform::gui::KeyCode::PageUp), [](TextHostControlService* service, StringView text, @@ -96,6 +106,7 @@ std::vector<TextControlMovePattern> TextControlMovePattern::kDefaultPatterns = { TextControlMovePattern::kCtrlLeft, TextControlMovePattern::kCtrlRight, TextControlMovePattern::kUp, TextControlMovePattern::kDown, TextControlMovePattern::kHome, TextControlMovePattern::kEnd, + TextControlMovePattern::kCtrlHome, TextControlMovePattern::kCtrlEnd, TextControlMovePattern::kPageUp, TextControlMovePattern::kPageDown}; TextHostControlService::TextHostControlService(gsl::not_null<Control*> control) |