Skip to content

Commit

Permalink
Merge pull request #18635 from hrydgard/some-new-toggles
Browse files Browse the repository at this point in the history
Add bindings for toggling mouse control and touch screen controls
  • Loading branch information
hrydgard committed Dec 29, 2023
2 parents 01d7361 + 00c8f62 commit ba6749d
Show file tree
Hide file tree
Showing 48 changed files with 117 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Core/KeyMap.cpp
Expand Up @@ -465,6 +465,9 @@ const KeyMap_IntStrPair psp_button_names[] = {
{VIRTKEY_TOGGLE_WLAN, "Toggle WLAN"},
{VIRTKEY_EXIT_APP, "Exit App"},

{VIRTKEY_TOGGLE_MOUSE, "Toggle mouse input"},
{VIRTKEY_TOGGLE_TOUCH_CONTROLS, "Toggle touch controls"},

{VIRTKEY_AXIS_RIGHT_Y_MAX, "RightAn.Up"},
{VIRTKEY_AXIS_RIGHT_Y_MIN, "RightAn.Down"},
{VIRTKEY_AXIS_RIGHT_X_MIN, "RightAn.Left"},
Expand Down
2 changes: 2 additions & 0 deletions Core/KeyMap.h
Expand Up @@ -74,6 +74,8 @@ enum {
VIRTKEY_PREVIOUS_SLOT = 0x40000027,
VIRTKEY_TOGGLE_WLAN = 0x40000028,
VIRTKEY_EXIT_APP = 0x40000029,
VIRTKEY_TOGGLE_MOUSE = 0x40000030,
VIRTKEY_TOGGLE_TOUCH_CONTROLS = 0x40000031,
VIRTKEY_LAST,
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
};
Expand Down
24 changes: 23 additions & 1 deletion UI/EmuScreen.cpp
Expand Up @@ -788,7 +788,29 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
if (down)
System_ToggleFullscreenState("");
break;

case VIRTKEY_TOGGLE_TOUCH_CONTROLS:
if (down) {
if (g_Config.bShowTouchControls) {
// This just messes with opacity if enabled, so you can touch the screen again to bring them back.
if (GamepadGetOpacity() < 0.01f) {
GamepadTouch();
} else {
// Reset.
GamepadTouch(true);
}
} else {
// If touch controls are disabled though, they'll get enabled.
g_Config.bShowTouchControls = true;
RecreateViews();
GamepadTouch();
}
}
break;
case VIRTKEY_TOGGLE_MOUSE:
if (down) {
g_Config.bMouseControl = !g_Config.bMouseControl;
}
break;
case VIRTKEY_SCREENSHOT:
if (down)
g_TakeScreenshot = true;
Expand Down
4 changes: 2 additions & 2 deletions UI/GamepadEmu.cpp
Expand Up @@ -70,8 +70,8 @@ void GamepadUpdateOpacity(float force) {
g_gamepadOpacity = opacity * multiplier;
}

void GamepadTouch() {
g_lastTouch = time_now_d();
void GamepadTouch(bool reset) {
g_lastTouch = reset ? 0.0f : time_now_d();
}

float GamepadGetOpacity() {
Expand Down
2 changes: 1 addition & 1 deletion UI/GamepadEmu.h
Expand Up @@ -369,6 +369,6 @@ namespace GestureKey {
};
}

void GamepadTouch();
void GamepadTouch(bool reset = false);
void GamepadUpdateOpacity(float force = -1.0f);
float GamepadGetOpacity();
2 changes: 2 additions & 0 deletions assets/lang/ar_AE.ini
Expand Up @@ -826,6 +826,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = ‎تفعيل وضع الشاشة الكاملة
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = ‎مثلث
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/az_AZ.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/bg_BG.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/ca_ES.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/cz_CZ.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Rychle vpřed
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/da_DK.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Turbo
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/de_DE.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texturspeicherung
Texture Replacement = Texturersetzung
Toggle Fullscreen = Vollbild umschalten
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Dreieck
Fast-forward = Turbo
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/dr_ID.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/en_US.ini
Expand Up @@ -838,6 +838,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/es_ES.ini
Expand Up @@ -819,6 +819,8 @@ Texture Dumping = Volcar texturas
Texture Replacement = remplazar texturas
Toggle Fullscreen = Pantalla completa
Toggle mode = Alternar modo
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triángulo
Fast-forward = Modo turbo
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/es_LA.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Dumpear textura
Texture Replacement = Remplazo de textura
Toggle Fullscreen = Alternar pantalla completa
Toggle mode = Alternar modo
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = △
Fast-forward = Modo turbo
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/fa_IR.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/fi_FI.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Tekstuurien tallentaminen
Texture Replacement = Tekstuurien korvaus
Toggle Fullscreen = Vaihda koko ruudun tilan välillä
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Kolmio
Fast-forward = Pikakelaus
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/fr_FR.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Extraire textures
Texture Replacement = Remplacer textures
Toggle Fullscreen = Plein écran
Toggle mode = Mode basculement
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Vitesse max
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/gl_ES.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Modo turbo
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/gr_EL.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Εξαγωγή υφών
Texture Replacement = Αντικατάσταση υφών
Toggle Fullscreen = Λειτουργεία πλήρους οθόνης
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Τρίγωνο
Fast-forward = Γρήγορη προώθηση
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/he_IL.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/he_IL_invert.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/hr_HR.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Odlaganje tekstura
Texture Replacement = Mijenjanje tesktura
Toggle Fullscreen = Uključi puni zaslon
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/hu_HU.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Textúra kiírás
Texture Replacement = Textúra csere
Toggle Fullscreen = Teljes képernyő
Toggle mode = Üzemmód váltása
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Háromszög
Fast-forward = Gyorsítás
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/id_ID.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Pembuangan tekstur
Texture Replacement = Timpa tekstur
Toggle Fullscreen = Pengalihan layar penuh
Toggle mode = Mode pengalihan
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Segitiga
Fast-forward = Pemajuan cepat
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/it_IT.ini
Expand Up @@ -820,6 +820,8 @@ Texture Dumping = Dumping delle texture
Texture Replacement = Sostituzione delle texture
Toggle Fullscreen = Passa a Schermo Intero
Toggle mode = Modalità Scambio
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangolo
Up = D-Pad Su
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/ja_JP.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = テクスチャのダンプ
Texture Replacement = テクスチャの置換
Toggle Fullscreen = フルスクリーンの切り替え
Toggle mode = モードの切り替え
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = WLANの切り替え
Triangle = △
Fast-forward = 速度制限を解除
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/jv_ID.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/ko_KR.ini
Expand Up @@ -814,6 +814,8 @@ Texture Dumping = 텍스처 덤핑
Texture Replacement = 텍스처 교체
Toggle Fullscreen = 전체 화면 토글
Toggle mode = 모드 토글
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = 무선랜 토글
Triangle = 세모
Fast-forward = 빨리 감기
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/lo_LA.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = ເລັ່ງເທີໂບ
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/lt-LT.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/ms_MY.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/nl_NL.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Volledig scherm schakelen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Driehoek
Fast-forward = Versnellen
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/no_NO.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Fast-forward
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/pl_PL.ini
Expand Up @@ -823,6 +823,8 @@ Texture Dumping = Zrzut tekstur
Texture Replacement = Podmiana tekstur
Toggle Fullscreen = Wł./wył. pełny ekran
Toggle mode = Tryb przełączania
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Przełącz WLAN
Triangle = Trójkąt
Fast-forward = Pełna prędkość
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/pt_BR.ini
Expand Up @@ -838,6 +838,8 @@ Texture Dumping = Dumpagem das texturas
Texture Replacement = Substituição das texturas
Toggle Fullscreen = Alternar pra tela cheia
Toggle mode = Alternar modo
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Alternar WLAN
Triangle = Triângulo
Fast-forward = Avanço rápido
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/pt_PT.ini
Expand Up @@ -838,6 +838,8 @@ Texture Dumping = Dumpagem das texturas
Texture Replacement = Substituição das texturas
Toggle Fullscreen = Alternar para Tela Cheia
Toggle mode = Alternar modo
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Alternar WLAN
Triangle = Triângulo
Fast-forward = Avanço rápido
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/ro_RO.ini
Expand Up @@ -819,6 +819,8 @@ Texture Dumping = Texture dumping
Texture Replacement = Texture replacement
Toggle Fullscreen = Toggle fullscreen
Toggle mode = Toggle mode
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangle
Fast-forward = Repede inainte
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/ru_RU.ini
Expand Up @@ -818,6 +818,8 @@ Texture Dumping = Дамп текстур
Texture Replacement = Подмена текстур
Toggle Fullscreen = Полноэкр. режим
Toggle mode = Переключить режим
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Переключить WLAN
Triangle = Треугольник
Fast-forward = Перемотка вперед
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/sv_SE.ini
Expand Up @@ -819,6 +819,8 @@ Texture Dumping = Textur-dumpning
Texture Replacement = Textur-ersättning
Toggle Fullscreen = Växla fullskärm
Toggle mode = Toggla läge
Toggle mouse input = Toggle mouse input
Toggle touch controls = Toggle touch controls
Toggle WLAN = Toggle WLAN
Triangle = Triangel
Fast-forward = Snabbspola
Expand Down

0 comments on commit ba6749d

Please sign in to comment.