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 Jan 3, 2025
1 parent be4f1be commit c12aa25
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 @@ -588,7 +588,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 @@ -675,6 +675,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 c12aa25

Please sign in to comment.