Skip to content

Commit 468f2cb

Browse files
committed
PowerMode2003: Also handle L/R modifier keycode variants for the single key lookup method
1 parent 285998b commit 468f2cb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/game_runtime_patches.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,17 @@ namespace RuntimePatches::PowerMode2003 {
426426
if (input_key == Input::Keys::NONE) {
427427
Output::Debug("PowerMode2003: Unsupported keycode {}", vk_id);
428428
}
429-
if (!Input::IsRawKeyPressed(input_key)) {
429+
bool pressed = false;
430+
if (input_key == Input::Keys::SHIFT) {
431+
pressed = Input::IsRawKeyPressed(Input::Keys::LSHIFT) || Input::IsRawKeyPressed(Input::Keys::RSHIFT);
432+
} else if (input_key == Input::Keys::CTRL) {
433+
pressed = Input::IsRawKeyPressed(Input::Keys::LCTRL) || Input::IsRawKeyPressed(Input::Keys::RCTRL);
434+
} else if (input_key == Input::Keys::ALT) {
435+
pressed = Input::IsRawKeyPressed(Input::Keys::LALT) || Input::IsRawKeyPressed(Input::Keys::RALT);
436+
} else {
437+
pressed = Input::IsRawKeyPressed(input_key);
438+
}
439+
if (!pressed) {
430440
Main_Data::game_variables->Set(PM_VAR_KEY, 0);
431441
}
432442
} else {

0 commit comments

Comments
 (0)