desktop: rewrite reserved area handling + improve tests (#12383)

This commit is contained in:
Vaxry 2025-12-05 14:16:22 +00:00 committed by GitHub
parent d5c52ef58e
commit 9264436f35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 818 additions and 413 deletions

View file

@ -225,7 +225,7 @@ static SDispatchResult scroll(std::string in) {
}
static SDispatchResult keybind(std::string in) {
CVarList data(in);
CVarList2 data(std::move(in));
// 0 = release, 1 = press
bool press;
// See src/devices/IKeyboard.hpp : eKeyboardModifiers for modifier bitmasks
@ -234,9 +234,9 @@ static SDispatchResult keybind(std::string in) {
// keycode
uint32_t key;
try {
press = std::stoul(data[0]) == 1;
modifier = std::stoul(data[1]);
key = std::stoul(data[2]) - 8; // xkb offset
press = std::stoul(std::string{data[0]}) == 1;
modifier = std::stoul(std::string{data[1]});
key = std::stoul(std::string{data[2]}) - 8; // xkb offset
} catch (...) { return {.success = false, .error = "invalid input"}; }
uint32_t modifierMask = 0;