fix WASD input conflict with debug mode (#743)
Some checks are pending
CI / clang-format (push) Waiting to run
CI / ${{ matrix.name }} (false, --toolchain /usr/local/vitasdk/share/vita.toolchain.cmake, false, false, Ninja, Vita, ubuntu-latest, true, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, emcmake, false, false, true, Ninja, Emscripten, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, false, false, Ninja, true, MSVC (arm64), windows-latest, amd64_arm64, false) (push) Waiting to run
CI / ${{ matrix.name }} (false, false, true, Ninja, true, MSVC (x86), windows-latest, amd64_x86, false) (push) Waiting to run
CI / ${{ matrix.name }} (false, true, false, Ninja, true, MSVC (x64), windows-latest, amd64, false) (push) Waiting to run
CI / ${{ matrix.name }} (false, true, true, false, Ninja, true, MSVC (x64 Debug), windows-latest, amd64, false) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, -DCMAKE_SYSTEM_NAME=iOS, false, false, Xcode, true, iOS, macos-15, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, false, Ninja, true, mingw-w64-i686, mingw32, msys2 mingw32, windows-latest, msys2 {0}, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, false, false, Ninja, Android, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, true, false, Ninja, macOS, macos-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, true, false, Ninja, true, mingw-w64-x86_64, mingw64, msys2 mingw64, windows-latest, msys2 {0}, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux (Debug), ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux, ubuntu-latest, true) (push) Waiting to run
CI / Flatpak (${{ matrix.arch }}) (aarch64, ubuntu-22.04-arm) (push) Waiting to run
CI / Flatpak (${{ matrix.arch }}) (x86_64, ubuntu-latest) (push) Waiting to run
CI / C++ (push) Waiting to run
CI / Release (push) Blocked by required conditions
Docker / Publish web port (push) Waiting to run

This commit is contained in:
Ramen2X 2025-12-17 20:20:02 -05:00 committed by GitHub
parent 7e1cc77dbe
commit 3b56c9b607
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 2 deletions

View File

@ -132,6 +132,7 @@ class LegoInputManager : public MxPresenter {
void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; } void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; }
void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; } void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
MxBool GetWasd() { return m_wasd; }
void SetWasd(MxBool p_wasd) { m_wasd = p_wasd; } void SetWasd(MxBool p_wasd) { m_wasd = p_wasd; }
// FUNCTION: BETA10 0x1002e390 // FUNCTION: BETA10 0x1002e390

View File

@ -655,7 +655,44 @@ MxLong LegoNavController::Notify(MxParam& p_param)
{ {
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationKeyPress) { if (((MxNotificationParam&) p_param).GetNotification() == c_notificationKeyPress) {
m_unk0x5d = TRUE; m_unk0x5d = TRUE;
SDL_Keycode key = ((LegoEventNotificationParam&) p_param).GetKey(); SDL_Keycode originKey = ((LegoEventNotificationParam&) p_param).GetKey();
SDL_Keycode key = originKey;
// This is necessary so any players using the WASD movement option can
// also use Debug Mode, which normally makes use of the WASD keys.
//
// For those players, we just swap the two and remap
// those conflicting debug keys to the arrow keys.
if (LegoOmni::GetInstance()->GetInputManager()->GetWasd()) {
switch (originKey) {
case SDLK_W:
key = SDLK_UP;
break;
case SDLK_A:
key = SDLK_LEFT;
break;
case SDLK_S:
key = SDLK_DOWN;
break;
case SDLK_D:
key = SDLK_RIGHT;
break;
case SDLK_UP:
key = SDLK_W;
break;
case SDLK_LEFT:
key = SDLK_A;
break;
case SDLK_DOWN:
key = SDLK_S;
break;
case SDLK_RIGHT:
key = SDLK_D;
break;
default:
break;
}
}
switch (key) { switch (key) {
case SDLK_PAUSE: // Pause game case SDLK_PAUSE: // Pause game
@ -763,7 +800,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
// Check if the the key is part of the debug password // Check if the the key is part of the debug password
if (!*g_currentInput) { if (!*g_currentInput) {
// password "protected" debug shortcuts // password "protected" debug shortcuts
switch (((LegoEventNotificationParam&) p_param).GetKey()) { switch (key) {
case SDLK_TAB: case SDLK_TAB:
VideoManager()->ToggleFPS(g_fpsEnabled); VideoManager()->ToggleFPS(g_fpsEnabled);
if (g_fpsEnabled) { if (g_fpsEnabled) {