diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-04 18:44:51 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-04 18:44:51 +0100 |
commit | 096ee0c2670f176cfab76d54a440e5d9201d79b4 (patch) | |
tree | 4201e6334f8f5111365d1adc727c86b3bcdd2aa7 /include | |
parent | 3dad7a548751b43b0e06e3bd6e869feec4c500f0 (diff) |
Add ctrl+arrow key to move by word in text input, fix search triggering with backspace repeat char
Diffstat (limited to 'include')
-rw-r--r-- | include/SearchBar.hpp | 1 | ||||
-rw-r--r-- | include/Text.hpp | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/SearchBar.hpp b/include/SearchBar.hpp index de3b686..78420ec 100644 --- a/include/SearchBar.hpp +++ b/include/SearchBar.hpp @@ -66,6 +66,7 @@ namespace QuickMedia { bool needs_update; bool input_masked; bool typing; + int backspace_seq_count; float vertical_pos; sf::Clock time_since_search_update; }; diff --git a/include/Text.hpp b/include/Text.hpp index e471441..f102c59 100644 --- a/include/Text.hpp +++ b/include/Text.hpp @@ -111,12 +111,16 @@ namespace QuickMedia HOME, END, LEFT, - RIGHT + RIGHT, + LEFT_WORD, + RIGHT_WORD }; void updateCaret(); int getStartOfLine(int startIndex) const; int getEndOfLine(int startIndex) const; + int getStartOfWord(int startIndex) const; + int getEndOfWord(int startIndex) const; int getPreviousLineClosestPosition(int startIndex) const; int getNextLineClosestPosition(int startIndex) const; @@ -130,6 +134,7 @@ namespace QuickMedia VertexRef& get_vertex_ref_clamp(int index); // Takes into consideration if index is the last vertex and the last vertex is a newline, then it should be on its own line int get_vertex_line(int index) const; + sf::Uint32 get_vertex_codepoint(int index) const; private: sf::String str; // TODO: Remove this for non-editable text??? also replace with std::string? then we get more efficient editing of text const bool bold_font; |