aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-11-17 19:41:39 +0800
committercrupest <crupest@outlook.com>2021-11-17 19:41:39 +0800
commit0f3e84f0ef4c62d20e5cb4d9e5677ec39afb894d (patch)
treed1f4c0686fd12f82b8af5b3ca015b5d995d773ff /include
parent7be210036e363f2105ace761451448507d4b06d8 (diff)
downloadcru-0f3e84f0ef4c62d20e5cb4d9e5677ec39afb894d.tar.gz
cru-0f3e84f0ef4c62d20e5cb4d9e5677ec39afb894d.tar.bz2
cru-0f3e84f0ef4c62d20e5cb4d9e5677ec39afb894d.zip
...
Diffstat (limited to 'include')
-rw-r--r--include/cru/platform/gui/Keyboard.hpp7
-rw-r--r--include/cru/ui/controls/TextHostControlService.hpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/include/cru/platform/gui/Keyboard.hpp b/include/cru/platform/gui/Keyboard.hpp
index 926b8d91..347b57bc 100644
--- a/include/cru/platform/gui/Keyboard.hpp
+++ b/include/cru/platform/gui/Keyboard.hpp
@@ -125,8 +125,15 @@ struct KeyModifiers {
static constexpr KeyModifier shift{0b1};
static constexpr KeyModifier ctrl{0b10};
static constexpr KeyModifier alt{0b100};
+ static constexpr KeyModifier command{0b1000};
};
+#ifdef CRU_PLATFORM_OSX
+constexpr KeyModifier kKeyModifierCommand = KeyModifiers::command;
+#else
+constexpr KeyModifier kKeyModifierCommand = KeyModifiers::ctrl;
+#endif
+
CRU_PLATFORM_GUI_API String ToString(KeyCode key_code);
CRU_PLATFORM_GUI_API String ToString(KeyModifier key_modifier,
StringView separator = u"+");
diff --git a/include/cru/ui/controls/TextHostControlService.hpp b/include/cru/ui/controls/TextHostControlService.hpp
index f63a45c2..1b0908ce 100644
--- a/include/cru/ui/controls/TextHostControlService.hpp
+++ b/include/cru/ui/controls/TextHostControlService.hpp
@@ -119,6 +119,8 @@ class TextHostControlService : public Object {
void SetSelection(gsl::index caret_position);
void SetSelection(TextRange selection, bool scroll_to_caret = true);
+ void SelectAll();
+
void ChangeSelectionEnd(gsl::index new_end);
void AbortSelection();