From 123a8f8fa32b224300a7e8ba6e85d973627b4afa Mon Sep 17 00:00:00 2001 From: The412Banner Date: Thu, 24 Sep 2026 21:31:25 -0400 Subject: [PATCH] Dolphin: guide = its Toggle Fullscreen hotkey (full default Hotkeys.ini), Wii Home on R1, input without focus from the rail --- .../com/droiddeck/launcher/SessionActivity.kt | 21 ------ .../droiddeck/launcher/frontend/Library.kt | 11 +-- .../usr/local/bin/bannerlator-pad-defaults | 72 ++++++++++++++++++- 3 files changed, 78 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt index 7327737425..5a36bc60b2 100644 --- a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt @@ -736,20 +736,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { return super.dispatchKeyEvent(event) } if (pcKeyboardOpen && event.device != null && PadBridge.isFromController(event.device)) return super.dispatchKeyEvent(event) - // Dolphin (PC) has no controller menu of its own: in a Dolphin game from the rail the guide - // button is its Toggle Fullscreen hotkey (Alt+Return, Dolphin's default) instead, which - // brings up Dolphin's window with its Config / Graphics / Stop buttons, and back again. - if (event.keyCode == KeyEvent.KEYCODE_BUTTON_MODE && guideIsDolphinFullscreen() && - event.device != null && PadBridge.isFromController(event.device) - ) { - if (event.action == KeyEvent.ACTION_DOWN && event.repeatCount == 0 && CompositorHost.isStarted) { - WaylandCompositor.nativeSendKey(KEY_LEFTALT, 1) - WaylandCompositor.nativeSendKey(KEY_ENTER, 1) - WaylandCompositor.nativeSendKey(KEY_ENTER, 0) - WaylandCompositor.nativeSendKey(KEY_LEFTALT, 0) - } - return true - } if (event.keyCode != KeyEvent.KEYCODE_BACK && padBridge?.onKeyEvent(event) == true) return true // A hardware keyboard, forwarded to the compositor's wl_keyboard. Back is left to the // activity, which opens the drawer. @@ -1008,10 +994,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { if (reset) secondScreenMode = SecondScreenMode.NONE } - private fun guideIsDolphinFullscreen(): Boolean = - SessionState.mode == SessionService.MODE_RUN && - SessionState.program?.substringAfterLast('/')?.startsWith("dolphin") == true - /** Touchpad on the desktop, direct in Steam, unless the drawer says otherwise. */ private fun usingTouchpad(): Boolean = when (SessionPrefs.touchMode(this)) { SessionPrefs.TOUCH_PAD -> true @@ -1209,9 +1191,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { } companion object { - // evdev codes (linux/input-event-codes.h) for the Alt+Return sent to Dolphin. - private const val KEY_LEFTALT = 56 - private const val KEY_ENTER = 28 private const val TAG = "SessionActivity" private const val BACK_DOUBLE_PRESS_TIMEOUT_MS = 500L private const val DRAWER_HAT_THRESHOLD = 0.5f diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt b/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt index fd5e786395..d024d86148 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt @@ -221,13 +221,16 @@ object Library { "duckstation" -> listOf("-batch", "-bigpicture", "-fullscreen", "--", guestPath) // Dolphin: full screen, drawn inside its own main window, without its "stop the emulation?" // question; no warning boxes either, which wait for a click a controller cannot give - // (they still go to Dolphin's log). The guide button toggles full screen (SessionActivity), - // which shows Dolphin's window and its settings - so no -b, which hides that window. - // Closing Dolphin ends the session. -C sets a Dolphin.ini value for this run only, so - // Dolphin started from the desktop keeps its own window and its warnings. + // (they still go to Dolphin's log). The guide button is Dolphin's Toggle Fullscreen hotkey + // (bannerlator-pad-defaults), which shows Dolphin's window and its settings - so no -b, which + // hides that window; closing Dolphin ends the session. Under gamescope Dolphin does not + // always see its window as focused, and by default both its hotkeys and the game's + // controller then stop: HotkeysRequireFocus off, BackgroundInput on. -C sets a Dolphin.ini + // value for this run only, so Dolphin started from the desktop keeps its own settings. "dolphin" -> listOf( "-C", "Dolphin.Display.Fullscreen=True", "-C", "Dolphin.Display.RenderToMain=True", "-C", "Dolphin.Interface.ConfirmStop=False", "-C", "Dolphin.Interface.UsePanicHandlers=False", + "-C", "Dolphin.General.HotkeysRequireFocus=False", "-C", "Dolphin.Input.BackgroundInput=True", "-e", guestPath, ) "cemu" -> listOf("-g", guestPath) diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-pad-defaults b/tools/linuxfs/overlay/usr/local/bin/bannerlator-pad-defaults index 2251bedf37..954916d296 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-pad-defaults +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-pad-defaults @@ -383,7 +383,7 @@ Buttons/1 = `Button W` Buttons/2 = `Button N` Buttons/- = `Back` Buttons/+ = `Start` -Buttons/Home = `Guide` +Buttons/Home = `Shoulder R` D-Pad/Up = `Pad N` D-Pad/Down = `Pad S` D-Pad/Left = `Pad W` @@ -510,6 +510,63 @@ def armsx2_bios(ini): print(f"bannerlator-pad-defaults: ARMSX2: BIOS {pick}") +# Dolphin (PC) has no controller menu, so the guide button is its Toggle Fullscreen hotkey: out of full +# screen is Dolphin's own window with its Config / Graphics / Stop buttons. Hotkeys.ini is all-or- +# nothing - a file with one line drops every other default - so a new one carries Dolphin's defaults, +# generated from HotkeyManager.cpp's LoadDefaults (Linux branch, RetroAchievements on) plus the guide; +# an existing one only gets the guide added to its Toggle Fullscreen. The Wii remote's Home, which +# was on the guide button, is on the right shoulder button instead. +DOLPHIN_GUIDE = "`SDL/0/Xbox 360 Controller:Guide`" +DOLPHIN_HOTKEYS = """[Hotkeys] +Device = XInput2/0/Virtual core pointer +General/Open = @(Ctrl+O) +General/Toggle Pause = F10 +General/Stop = Escape +General/Toggle Fullscreen = @(Alt+Return) | `SDL/0/Xbox 360 Controller:Guide` +General/Take Screenshot = F9 +General/Open Achievements = @(Alt+A) +Emulation Speed/Disable Emulation Speed Limit = Tab +Stepping/Step Into = F11 +Stepping/Step Over = @(Shift+F10) +Stepping/Step Out = @(Shift+F11) +Breakpoint/Toggle Breakpoint = @(Shift+F9) +Wii/Connect Wii Remote 1 = @(Alt+F5) +Wii/Connect Wii Remote 2 = @(Alt+F6) +Wii/Connect Wii Remote 3 = @(Alt+F7) +Wii/Connect Wii Remote 4 = @(Alt+F8) +Wii/Connect Balance Board = @(Alt+F9) +Load State/Load State Slot 1 = F1 +Load State/Load State Slot 2 = F2 +Load State/Load State Slot 3 = F3 +Load State/Load State Slot 4 = F4 +Load State/Load State Slot 5 = F5 +Load State/Load State Slot 6 = F6 +Load State/Load State Slot 7 = F7 +Load State/Load State Slot 8 = F8 +Save State/Save State Slot 1 = @(Shift+F1) +Save State/Save State Slot 2 = @(Shift+F2) +Save State/Save State Slot 3 = @(Shift+F3) +Save State/Save State Slot 4 = @(Shift+F4) +Save State/Save State Slot 5 = @(Shift+F5) +Save State/Save State Slot 6 = @(Shift+F6) +Save State/Save State Slot 7 = @(Shift+F7) +Save State/Save State Slot 8 = @(Shift+F8) +Other State Hotkeys/Undo Load State = F12 +Other State Hotkeys/Undo Save State = @(Shift+F12) +GBA Core/Load ROM = @(`Ctrl`+`Shift`+`O`) +GBA Core/Unload ROM = @(`Ctrl`+`Shift`+`W`) +GBA Core/Reset = @(`Ctrl`+`Shift`+`R`) +GBA Volume/Volume Down = `KP_Subtract` +GBA Volume/Volume Up = `KP_Add` +GBA Volume/Volume Toggle Mute = `M` +GBA Window Size/1x = `KP_1` +GBA Window Size/2x = `KP_2` +GBA Window Size/3x = `KP_3` +GBA Window Size/4x = `KP_4` +USB Emulation Devices/Show Skylanders Portal = @(Ctrl+P) +USB Emulation Devices/Show Infinity Base = @(Ctrl+I) +""" + DOLPHIN_APPIMAGE = "/opt/appimages/dolphin.AppImage" DOLPHIN_DATA = "/usr/share/dolphin-emu" @@ -562,6 +619,19 @@ def dolphin(): d = os.path.join(CONFIG, "dolphin-emu") seed(os.path.join(d, "GCPadNew.ini"), DOLPHIN_GC, "Dolphin (GameCube)") seed(os.path.join(d, "WiimoteNew.ini"), DOLPHIN_WII, "Dolphin (Wii)") + wii_pad = os.path.join(d, "WiimoteNew.ini") + if ini_get(wii_pad, "Wiimote1", "Buttons/Home") == "`Guide`": + ini_set(wii_pad, "Wiimote1", "Buttons/Home", "`Shoulder R`") + print("bannerlator-pad-defaults: Dolphin (Wii): Home on the right shoulder button (guide = Dolphin's window)") + hotkeys = os.path.join(d, "Hotkeys.ini") + if not os.path.isfile(hotkeys): + seed(hotkeys, DOLPHIN_HOTKEYS, "Dolphin", "the guide button shows Dolphin's window (Toggle Fullscreen)") + else: + current = ini_get(hotkeys, "Hotkeys", "General/Toggle Fullscreen") + if current is not None and DOLPHIN_GUIDE not in current: + ini_set(hotkeys, "Hotkeys", "General/Toggle Fullscreen", + (current + " | " if current else "") + DOLPHIN_GUIDE) + print("bannerlator-pad-defaults: Dolphin: the guide button shows Dolphin's window (Toggle Fullscreen)") # Games from the ROMs folder's gamecube and wii folders, subfolders included; Vulkan; no # NKit warning (it will not let a game start until a box is ticked - games run either way, # the warning is about loading times, netplay and save states); no statistics question.