Add native streamer app shortcut integration#469
Conversation
There was a problem hiding this comment.
💡 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".
|
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? |
|
@zaloguj12 will look into this ;) |
|
can you fix codex issues |
|
i will try when i get home |
|
@zortos293 should be fixed |
|
nvm |
|
now should be fine 👍 |
|
@zaloguj12 please update the branch with the current ref |
|
@codex review |
There was a problem hiding this comment.
💡 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".
Made by codex
|
@codex review |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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. |
Made by codex
|
@codex review |
There was a problem hiding this comment.
💡 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".
| screenshot: "", | ||
| toggleRecording: "", |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
[🟡 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); |
There was a problem hiding this comment.
[🟡 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);|
someone on windows needs to test this atm not on windows |
Description
Verification
npm --prefix opennow-stable run typechecknpm --prefix opennow-stable run buildcargo test(innative/opennow-streamer)