Merge pull request #15494 from iota97/InternalRotationBind

Add key bind to hotswap internal screen rotation
This commit is contained in:
Henrik Rydgård 2022-04-24 00:06:33 +02:00 committed by GitHub
commit a8ddde5a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View File

@ -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"},

View File

@ -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
};

View File

@ -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;
}
}