Skip to content

Commit

Permalink
Fix xterm parsing. unsigned vs signed char problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurSonzogni authored and stephanroslen committed Oct 16, 2020
1 parent 5083e9d commit d4c975e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/util/print_key_press.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DrawKey : public Component {
for (size_t i = std::max(0, (int)keys.size() - 10); i < keys.size(); ++i) {
std::wstring code;
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")";
children.push_back(text(code));
Expand Down
2 changes: 1 addition & 1 deletion src/ftxui/component/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Event Event::GetEvent(std::function<char()> getchar) {
return ParseESC(getchar, input);
}

if (input[0] < 32) // C0
if (input[0] >= 0 && input[0] < 32) // C0
return Event::Special(input);

return ParseUTF8(getchar, input);
Expand Down

0 comments on commit d4c975e

Please sign in to comment.