Skip to content

Commit

Permalink
Disable mouse LS emulation if SHIFT is held down
Browse files Browse the repository at this point in the history
  • Loading branch information
Clippy95 committed Dec 13, 2024
1 parent 93fef4a commit c11ca85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/xenia/hid/winkey/hookables/PerfectDarkZero.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const uint32_t kTitleIdPerfectDarkZero = 0x4D5307D3;
namespace xe {
namespace hid {
namespace winkey {
bool __inline IsKeyDown(uint8_t key) {
return (GetAsyncKeyState(key) & 0x8000) == 0x8000;
}
struct GameBuildAddrs {
const char* build_string;
uint32_t build_string_addr;
Expand Down Expand Up @@ -492,7 +495,7 @@ void PerfectDarkZeroGame::HandleRightStickEmulation(RawInputState& input_state,
if (!LSmode) {
out_state->gamepad.thumb_rx = static_cast<short>(accumulated_x);
out_state->gamepad.thumb_ry = static_cast<short>(accumulated_y);
} else {
} else if (LSmode && !IsKeyDown(VK_SHIFT)) {
out_state->gamepad.thumb_lx = static_cast<short>(accumulated_x);
out_state->gamepad.thumb_ly = static_cast<short>(accumulated_y);
}
Expand Down

0 comments on commit c11ca85

Please sign in to comment.