diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-03-10 19:33:46 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-03-10 19:50:22 +0000 |
| commit | 3c1a325b6f7c67c530d99aaaedf5f8c96f2b2de6 (patch) | |
| tree | f6cdaf2eec33dee178e3c888f5120ea43479b157 /src/keys.cc | |
| parent | a0cf75ec39c679776b28b178a4299cf0ad204a1c (diff) | |
Refactor String, use a common StringOps interface, hide std::string
Diffstat (limited to 'src/keys.cc')
| -rw-r--r-- | src/keys.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/keys.cc b/src/keys.cc index b328252c..7dd45383 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -64,9 +64,9 @@ KeyList parse_keys(StringView str) Key::Modifiers modifier = Key::Modifiers::None; StringView desc{it.base()+1, end_it.base()}; - if (desc.length() > 2 and desc[1] == '-') + if (desc.length() > 2 and desc[1_byte] == '-') { - switch(tolower(desc[0])) + switch(tolower(desc[0_byte])) { case 'c': modifier = Key::Modifiers::Control; break; case 'a': modifier = Key::Modifiers::Alt; break; @@ -82,7 +82,7 @@ KeyList parse_keys(StringView str) result.push_back(canonicalize_ifn({ modifier, name_it->key })); else if (desc.char_length() == 1) result.push_back(Key{ modifier, desc[0_char] }); - else if (tolower(desc[0]) == 'f' and desc.length() <= 3) + else if (tolower(desc[0_byte]) == 'f' and desc.length() <= 3) { int val = str_to_int(desc.substr(1_byte)); if (val >= 1 and val <= 12) |
