diff --git a/examples/util/print_key_press.cpp b/examples/util/print_key_press.cpp index ccb34a3e..fa32ee79 100644 --- a/examples/util/print_key_press.cpp +++ b/examples/util/print_key_press.cpp @@ -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)); diff --git a/src/ftxui/component/event.cpp b/src/ftxui/component/event.cpp index 4b3faac3..e87eb9fe 100644 --- a/src/ftxui/component/event.cpp +++ b/src/ftxui/component/event.cpp @@ -128,7 +128,7 @@ Event Event::GetEvent(std::function 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);