Fix xterm parsing. unsigned vs signed char problem.

This commit is contained in:
ArthurSonzogni 2019-06-23 17:59:34 +02:00
parent 001a0ae925
commit 9c1913de51
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class DrawKey : public Component {
for (size_t i = std::max(0, (int)keys.size() - 10); i < keys.size(); ++i) { for (size_t i = std::max(0, (int)keys.size() - 10); i < keys.size(); ++i) {
std::wstring code; std::wstring code;
for(auto& it : keys[i].input()) for(auto& it : keys[i].input())
code += L" " + std::to_wstring((int)it); code += L" " + std::to_wstring((unsigned int)it);
code = L"(" + code + L" ) -> " + keys[i].character() + L")"; code = L"(" + code + L" ) -> " + keys[i].character() + L")";
children.push_back(text(code)); children.push_back(text(code));

View File

@ -128,7 +128,7 @@ Event Event::GetEvent(std::function<char()> getchar) {
return ParseESC(getchar, input); return ParseESC(getchar, input);
} }
if (input[0] < 32) // C0 if (input[0] >= 0 && input[0] < 32) // C0
return Event::Special(input); return Event::Special(input);
return ParseUTF8(getchar, input); return ParseUTF8(getchar, input);