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 bindings for toggling mouse control and touch screen controls #18635

Merged
merged 2 commits into from
Dec 29, 2023
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
3 changes: 3 additions & 0 deletions Core/KeyMap.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading