Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add key bind to hotswap internal screen rotation #15494

Merged
merged 2 commits into from
Apr 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Core/KeyMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ const KeyMap_IntStrPair psp_button_names[] = {
{VIRTKEY_ANALOG_ROTATE_CW, "Rotate Analog (CW)"},
{VIRTKEY_ANALOG_ROTATE_CCW, "Rotate Analog (CCW)"},

{VIRTKEY_SCREEN_ROTATION_VERTICAL, "Display Portrait"},
{VIRTKEY_SCREEN_ROTATION_VERTICAL180, "Display Portrait Reversed"},
{VIRTKEY_SCREEN_ROTATION_HORIZONTAL, "Display Landscape"},
{VIRTKEY_SCREEN_ROTATION_HORIZONTAL180, "Display Landscape Reversed"},

{CTRL_HOME, "Home"},
{CTRL_HOLD, "Hold"},
{CTRL_WLAN, "Wlan"},
Expand Down
4 changes: 4 additions & 0 deletions Core/KeyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ enum {
VIRTKEY_OPENCHAT = 0x4000001D,
VIRTKEY_ANALOG_ROTATE_CW = 0x4000001E,
VIRTKEY_ANALOG_ROTATE_CCW = 0x4000001F,
VIRTKEY_SCREEN_ROTATION_VERTICAL = 0x40000020,
VIRTKEY_SCREEN_ROTATION_VERTICAL180 = 0x40000021,
VIRTKEY_SCREEN_ROTATION_HORIZONTAL = 0x40000022,
VIRTKEY_SCREEN_ROTATION_HORIZONTAL180 = 0x40000023,
VIRTKEY_LAST,
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
};
Expand Down
12 changes: 12 additions & 0 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,18 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
case VIRTKEY_MUTE_TOGGLE:
g_Config.bEnableSound = !g_Config.bEnableSound;
break;
case VIRTKEY_SCREEN_ROTATION_VERTICAL:
g_Config.iInternalScreenRotation = ROTATION_LOCKED_VERTICAL;
break;
case VIRTKEY_SCREEN_ROTATION_VERTICAL180:
g_Config.iInternalScreenRotation = ROTATION_LOCKED_VERTICAL180;
break;
case VIRTKEY_SCREEN_ROTATION_HORIZONTAL:
g_Config.iInternalScreenRotation = ROTATION_LOCKED_HORIZONTAL;
break;
case VIRTKEY_SCREEN_ROTATION_HORIZONTAL180:
g_Config.iInternalScreenRotation = ROTATION_LOCKED_HORIZONTAL180;
break;
}
}

Expand Down