Skip to content

Commit

Permalink
Keyboard light fixes (#47)
Browse files Browse the repository at this point in the history
* Fix bindings freezing / breaking when hitting certain shortcuts/hotkeys

* Fix keys getting stuck if they were heldwhile window became inactive

* Simplify else statement tip from @AdrianCassar

---------

Co-authored-by: Clippy95 <[email protected]>
  • Loading branch information
2 people authored and marinesciencedude committed Dec 19, 2024
1 parent a4f2b9b commit 184fb00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/xenia/hid/winkey/winkey_input_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ X_RESULT WinKeyInputDriver::GetState(uint32_t user_index,
const auto vk_key = static_cast<ui::VirtualKey>(i);

if (!binds.count(vk_key)) {
break;
continue;
}

const auto binding = binds.at(vk_key);
Expand Down Expand Up @@ -670,6 +670,10 @@ X_RESULT WinKeyInputDriver::GetState(uint32_t user_index,
}
}
}
} else { // So keys don't get 'stuck' if they were held previously when
// tabbing in and out from the window
memset(key_states_, 0, 256);
mouse_events_ = {};
}

out_state->packet_number = packet_number_;
Expand Down

0 comments on commit 184fb00

Please sign in to comment.