Dolphin: guide = its Toggle Fullscreen hotkey (full default Hotkeys.ini), Wii Home on R1, input without focus from the rail

This commit is contained in:
The412Banner committed 2026-09-24 21:31:25 -04:00
1 parent d38586edb1
commit 123a8f8fa3
3 files changed
+78 -26

No files matched your search

@@ -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
@@ -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)