Skip to content

Allow simultaneous controller, mouse, and keyboard input during streaming#143

Open
Jayian1890 wants to merge 22 commits intoOpenCloudGaming:devfrom
Jayian1890:fix-simultaneous-input
Open

Allow simultaneous controller, mouse, and keyboard input during streaming#143
Jayian1890 wants to merge 22 commits intoOpenCloudGaming:devfrom
Jayian1890:fix-simultaneous-input

Conversation

@Jayian1890
Copy link

Problem

When a controller was connected and in use during a stream, mouse and keyboard input would be locked out (suppressed). Similarly, controller input would be blocked when mouse/keyboard was active. This made it impossible to use multiple input methods simultaneously.

Root Cause

The GfnWebRtcClient had an exclusive activeInputMode property that toggled between "mkb" (mouse+keyboard) and "gamepad" modes. When mode switched to "gamepad", all keyboard, mouse movement, mouse button, and mouse wheel events were silently dropped. A 3-second lockout (GAMEPAD_MODE_LOCKOUT_MS) prevented switching back to "mkb" even after putting down the controller.

Solution

Remove the exclusive input mode switching system entirely and allow all input types to operate concurrently:

  • Removed activeInputMode property and GAMEPAD_MODE_LOCKOUT_MS constant
  • Removed ensureKeyboardInputMode() method
  • Removed input mode checks from onKeyDown, onKeyUp, onMouseDown, onMouseUp, onWheel, queueMouseMovement, and the mouse flush timer
  • Modified gamepad keepalive to send continuously while a controller is connected (previously only sent in "gamepad" mode)

Result

All input methods — controller, mouse, and keyboard — now work simultaneously during active streaming sessions.

- Introduced `requestKeyframe` method in GfnSignalingClient to send keyframe requests with reason, backlog frames, and attempt count.
- Added IPC handler for keyframe requests in the main process.
- Updated preload API to include `requestKeyframe` method.
- Enhanced StreamView component to manage sidebar tabs for preferences and shortcuts.
- Implemented decoder pressure detection and recovery mechanisms in GfnWebRtcClient, including bitrate reduction and keyframe requests.
- Updated diagnostics to track decoder pressure state and recovery attempts.
- Styled sidebar tabs for better user experience.
- Introduced new settings for recording shortcuts in settings.ts and App.tsx.
- Implemented recording API methods in preload/index.ts for starting, stopping, and managing recordings.
- Enhanced StreamView component to handle recording state, display recording controls, and show recordings in a sidebar.
- Added CSS styles for recording indicators and recording cards in styles.css.
- Updated IPC channels in ipc.ts to support recording operations.
- Defined new types for recording requests and entries in gfn.ts.
…ming

Remove exclusive input mode switching that prevented concurrent use of
different input methods. Previously, when a controller was active, mouse
and keyboard input would be suppressed, and vice versa.

Changes:
- Remove activeInputMode property and mode switching logic
- Remove input mode checks from mouse/keyboard event handlers
- Modify gamepad keepalive to work continuously instead of mode-dependent
- Allow all input types (controller, mouse, keyboard) to work simultaneously

This enables users to use controllers for gameplay while still having
access to mouse/keyboard for UI navigation and other inputs.
@Jayian1890 Jayian1890 changed the base branch from main to dev March 7, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant