From 83aa6ffed862bc0fa7a1da54b2f84b3e132f5113 Mon Sep 17 00:00:00 2001 From: Barry Van Deerlin Date: Sun, 28 Sep 2025 19:29:26 -0700 Subject: [PATCH] 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 OA and so on for the arrow keys instead of [A --- src/btop_input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btop_input.cpp b/src/btop_input.cpp index 5ee98d4..70ef08e 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -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