Skip to content

Add native streamer app shortcut integration#469

Merged
zortos293 merged 14 commits into
OpenCloudGaming:devfrom
zaloguj12:dev
Jun 4, 2026
Merged

Add native streamer app shortcut integration#469
zortos293 merged 14 commits into
OpenCloudGaming:devfrom
zaloguj12:dev

Conversation

@zaloguj12
Copy link
Copy Markdown
Contributor

Description

  • pass the existing configurable stream shortcut bindings into the native streamer session context
  • add a native shortcut matcher around the Win32/GStreamer input bridge so app shortcuts are intercepted before being forwarded into the stream
  • route native shortcut actions back through the existing renderer control flow, while keeping native pointer-lock capture toggling local to the streamer window

Verification

  • npm --prefix opennow-stable run typecheck
  • npm --prefix opennow-stable run build
  • cargo test (in native/opennow-streamer)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec7c564dc7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread native/opennow-streamer/src/gstreamer_input.rs Outdated
Comment thread opennow-stable/src/renderer/src/App.tsx
Comment thread native/opennow-streamer/src/gstreamer_platform.rs Outdated
@capy-ai
Copy link
Copy Markdown
Contributor

capy-ai Bot commented May 17, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@zaloguj12
Copy link
Copy Markdown
Contributor Author

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

son?

@zortos293
Copy link
Copy Markdown
Collaborator

@zaloguj12 will look into this ;)

@zortos293
Copy link
Copy Markdown
Collaborator

can you fix codex issues

@zaloguj12
Copy link
Copy Markdown
Contributor Author

i will try when i get home

@zaloguj12
Copy link
Copy Markdown
Contributor Author

@zortos293 should be fixed

@zaloguj12
Copy link
Copy Markdown
Contributor Author

nvm

@zaloguj12
Copy link
Copy Markdown
Contributor Author

now should be fine 👍

@Kief5555
Copy link
Copy Markdown
Collaborator

@zaloguj12 please update the branch with the current ref

@Kief5555 Kief5555 deleted the branch OpenCloudGaming:dev May 31, 2026 15:09
@Kief5555 Kief5555 closed this May 31, 2026
@Kief5555 Kief5555 reopened this May 31, 2026
@zaloguj12
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30dc5913ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread native/opennow-streamer/src/gstreamer_platform.rs Outdated
Comment thread native/opennow-streamer/src/gstreamer_platform.rs Outdated
Comment thread opennow-stable/src/main/signaling/signalingCoordinator.ts
@zaloguj12
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d559f2309

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread native/opennow-streamer/src/gstreamer_platform.rs
Comment thread native/opennow-streamer/src/gstreamer_platform.rs
Comment thread native/opennow-streamer/src/shortcuts.rs Outdated
Comment thread opennow-stable/src/renderer/src/App.tsx
Comment thread opennow-stable/src/shared/nativeStreamer.ts
@Kief5555 Kief5555 requested a review from Copilot June 1, 2026 04:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds native streamer shortcut integration by sending the user-configured shortcut bindings into the native streamer session context, intercepting matching shortcuts in the Win32 input bridge before forwarding input to the stream, and routing shortcut actions back into the existing renderer-side control flow (while keeping native pointer-lock capture toggling local to the streamer window).

Changes:

  • Extended the shared session context/protocol to include shortcut bindings, plus a new native “shortcut” event and an IPC path to update bindings during an active session.
  • Implemented a Windows native shortcut matcher in the Rust streamer that suppresses matched key events and emits shortcut actions back to the app.
  • Added renderer plumbing to handle native shortcut actions (including screenshot/recording via a small intra-renderer event bridge).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
opennow-stable/src/shared/nativeStreamer.ts Adds update-shortcuts command and a shortcut event to the native streamer message contract.
opennow-stable/src/shared/ipc.ts Introduces NATIVE_UPDATE_SHORTCUTS IPC channel constant.
opennow-stable/src/shared/gfn.ts Defines shortcut action/bindings types, includes bindings in native session context, and adds updateNativeShortcuts to OpenNowApi.
opennow-stable/src/shared/gfn.test.ts Updates unit test to pass/verify shortcut bindings in the native session context.
opennow-stable/src/renderer/src/streamShortcutActions.ts Adds a renderer-local event helper for dispatching/listening to native shortcut actions.
opennow-stable/src/renderer/src/components/StreamView.tsx Listens for native shortcut actions for screenshot/recording and keeps local key handling for those features.
opennow-stable/src/renderer/src/App.tsx Builds/pushes native shortcut bindings, listens for native shortcut events, and routes actions through existing controls.
opennow-stable/src/preload/index.ts Wires updateNativeShortcuts to IPC send.
opennow-stable/src/main/signaling/signalingCoordinator.ts Adds IPC listener to update native shortcut bindings and forwards updates to the native streamer manager.
opennow-stable/src/main/nativeStreamer/manager.ts Sends update-shortcuts requests to the native streamer and emits native-shortcut events to the renderer.
native/opennow-streamer/src/shortcuts.rs Implements parsing/matching of shortcut strings to Win32 key/modifier combos (with tests).
native/opennow-streamer/src/protocol.rs Adds shortcut bindings and shortcut action enum to the native streamer JSON protocol, plus a shortcut event variant.
native/opennow-streamer/src/main.rs Dispatches the new update-shortcuts command to the backend.
native/opennow-streamer/src/gstreamer_platform.rs Hooks shortcut matching into the Win32 window proc and updates raw input handling to suppress matched keys.
native/opennow-streamer/src/gstreamer_input.rs Forwards shortcut events immediately to the event channel (even before input readiness).
native/opennow-streamer/src/gstreamer_backend.rs Applies shortcut bindings on start/offer, supports runtime updates, and clears bindings on stop.
native/opennow-streamer/src/backend.rs Extends backend trait + stub backend to accept the update-shortcuts command.

Comment thread opennow-stable/src/renderer/src/App.tsx Outdated
@zaloguj12
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6143d6d2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +989 to +990
screenshot: "",
toggleRecording: "",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve native media shortcut bindings

When the native streamer is active the Win32/GStreamer window owns keyboard focus, so the renderer StreamView keydown listener cannot see the configured screenshot/recording hotkeys. Sending empty bindings here means the native matcher never intercepts F11/F12 (or user-customized values), and the existing screenshot/recording shortcuts stop working for native sessions even though the shared context and native protocol now carry those actions.

Useful? React with 👍 / 👎.

match upper.as_str() {
"BACKSPACE" => parsed_key(VK_BACK),
"TAB" => parsed_key(VK_TAB),
"ENTER" => parsed_scancode_key(VK_RETURN, SCANCODE_ENTER),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[🟡 Medium] [🔵 Bug]

The matcher now requires exact scancode matches, and this change constrains ENTER to SCANCODE_ENTER while NUMPADENTER uses a different scancode. Upstream shortcut capture canonicalizes both Enter variants to Enter, so a user binding recorded from numpad Enter is serialized as ENTER and will not trigger on numpad Enter in native matching. Either keep ENTER scancode-agnostic (legacy behavior) or ensure capture/serialization emits NUMPADENTER distinctly.

// native/opennow-streamer/src/shortcuts.rs
match upper.as_str() {
    "ENTER" => parsed_scancode_key(VK_RETURN, SCANCODE_ENTER),
    "NUMPADENTER" => parsed_scancode_key(VK_RETURN, SCANCODE_NUMPAD_ENTER),
    "PAUSE" => parsed_key(VK_PAUSE),

return false;
};

suppressed_keys.insert(key_id);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[🟡 Medium] [🔵 Bug]

A suppressed key is inserted on legacy keydown and only removed on legacy keyup, but the PR switches capture to raw input (RIDEV_NOLEGACY) during shortcut actions; when keyup is delivered via raw path (or not delivered as legacy), the stale key remains in LEGACY_SUPPRESSED_KEYS, causing later presses of that key to be swallowed unexpectedly. Clear the suppressed-key set when capture mode changes/release occurs (and during teardown) so suppression state cannot leak across input paths.

// native/opennow-streamer/src/gstreamer_platform.rs
if !pressed {
    return suppressed_keys.remove(&key_id);
}
...
suppressed_keys.insert(key_id);

@zortos293
Copy link
Copy Markdown
Collaborator

someone on windows needs to test this atm not on windows

@zortos293 zortos293 merged commit 2c4271a into OpenCloudGaming:dev Jun 4, 2026
6 checks passed
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.

4 participants