Skip to content

Commit

Permalink
Fix LB/RB not working
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jan 12, 2025
1 parent 52558b3 commit 61b1a98
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions library/lib/platforms/psv/psv_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ void PsvInputManager::updateControllerState(ControllerState* state, int controll
state->buttons[BUTTON_START] = pad.buttons & SCE_CTRL_START;
state->buttons[BUTTON_BACK] = pad.buttons & SCE_CTRL_SELECT;

state->buttons[BUTTON_LB] = pad.buttons & SCE_CTRL_L1;
state->buttons[BUTTON_RB] = pad.buttons & SCE_CTRL_R1;
state->buttons[BUTTON_LB] = pad.buttons & SCE_CTRL_L2;
state->buttons[BUTTON_RB] = pad.buttons & SCE_CTRL_R2;

if (Application::isSwapInputKeys())
{
Expand All @@ -107,10 +107,10 @@ void PsvInputManager::updateControllerState(ControllerState* state, int controll
state->axes[RIGHT_X] = pad.rx / 255.0f - 1.0f;
state->axes[RIGHT_Y] = pad.ry / 255.0f - 1.0f;

state->buttons[BUTTON_NAV_UP] = pad.ly < 0x40 || pad.ry < 0x40 || state->buttons[BUTTON_UP];
state->buttons[BUTTON_NAV_RIGHT] = pad.lx > 0xc0 || pad.rx > 0xc0 || state->buttons[BUTTON_RIGHT];
state->buttons[BUTTON_NAV_DOWN] = pad.ly > 0xc0 || pad.ry > 0xc0 || state->buttons[BUTTON_DOWN];
state->buttons[BUTTON_NAV_LEFT] = pad.lx < 0x40 || pad.rx < 0x40 || state->buttons[BUTTON_LEFT];
state->buttons[BUTTON_NAV_UP] = pad.ly < 0x20 || pad.ry < 0x20 || state->buttons[BUTTON_UP];
state->buttons[BUTTON_NAV_RIGHT] = pad.lx > 0xe0 || pad.rx > 0xe0 || state->buttons[BUTTON_RIGHT];
state->buttons[BUTTON_NAV_DOWN] = pad.ly > 0xe0 || pad.ry > 0xe0 || state->buttons[BUTTON_DOWN];
state->buttons[BUTTON_NAV_LEFT] = pad.lx < 0x20 || pad.rx < 0x20 || state->buttons[BUTTON_LEFT];
}

bool PsvInputManager::getKeyboardKeyState(BrlsKeyboardScancode key)
Expand Down

0 comments on commit 61b1a98

Please sign in to comment.