fix arrow keys that send 'O' instead of '['

Changing line in btop_input.cpp that compared first 2 characters of input to Fx::e.
Instead it now compares first character of input to first character of Fx::e and
checks that the length is greater then 1
This allows systems that send <ESC>OA and so on for the arrow keys
instead of <ESC>[A
This commit is contained in:
Barry Van Deerlin
2025-09-28 19:29:26 -07:00
committed by Jakob P. Liljenberg
parent a207f579c9
commit 83aa6ffed8

View File

@@ -122,7 +122,7 @@ namespace Input {
string key = input;
if (not key.empty()) {
//? Remove escape code prefix if present
if (key.substr(0, 2) == Fx::e) {
if (key.length() > 1 and key.at(0) == Fx::e.at(0)) {
key.erase(0, 1);
}
//? Detect if input is an mouse event