summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-02 22:58:25 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-02 22:58:25 +0300
commite1ec49e1934dfc25f21af7b9fa0a8f06fbea8aa3 (patch)
tree90ba22726db9411255afa5d878fe2b47702c9427 /src/utils
parent82194116950eb6977eca992df48fb265e4b5df6c (diff)
downloadmanaverse-e1ec49e1934dfc25f21af7b9fa0a8f06fbea8aa3.tar.gz
manaverse-e1ec49e1934dfc25f21af7b9fa0a8f06fbea8aa3.tar.bz2
manaverse-e1ec49e1934dfc25f21af7b9fa0a8f06fbea8aa3.tar.xz
manaverse-e1ec49e1934dfc25f21af7b9fa0a8f06fbea8aa3.zip
Add ctrl key combination to all text fields.
New keys: Ctrl+b,d,e,f,h,k,u,w Working like in most text editors.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp12
-rw-r--r--src/utils/stringutils.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index ad2e52965..13170092e 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -499,3 +499,15 @@ std::string stringToHexPath(const std::string &str)
hex += strprintf("%%%2x", (int)str[f]);
return hex;
}
+
+void deleteCharLeft(std::string &str, unsigned *pos)
+{
+ while (*pos > 0)
+ {
+ (*pos)--;
+ int v = str[*pos];
+ str.erase(*pos, 1);
+ if ((v & 192) != 128)
+ break;
+ }
+}
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index 4693b5425..94747d2fe 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -188,4 +188,6 @@ std::list<std::string> unpackList(const std::string &str);
std::string stringToHexPath(const std::string &str);
+void deleteCharLeft(std::string &str, unsigned *pos);
+
#endif // UTILS_STRINGUTILS_H