From e1ec49e1934dfc25f21af7b9fa0a8f06fbea8aa3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 2 Aug 2011 22:58:25 +0300 Subject: 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. --- src/utils/stringutils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/utils/stringutils.cpp') 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; + } +} -- cgit v1.2.3-70-g09d2