Repository navigation
feat: press media, volume and brightness keys as system-defined events - #80
Merged
Merged
Conversation
iamnbutler
force-pushed
the
feat/media-keys
branch
4 times, most recently
from
October 17, 2026 06:16
6168a35 to
829141f
Compare
iamnbutler
force-pushed
the
feat/media-keys
branch
from
October 17, 2026 06:29
829141f to
690bf1f
Compare
iamnbutler
force-pushed
the
feat/media-keys
branch
from
October 17, 2026 06:39
690bf1f to
829cfd2
Compare
This was referenced Oct 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
desktop_system_keynow also presses the media, volume and brightness keys:play_pause,next_track,previous_trackvolume_up,volume_down,mutebrightness_up,brightness_downkeyboard_brightness_up,keyboard_brightness_downThese keys take no modifiers. This closes the media-key part of #75.
How
These keys have no key code: the keyboard sends them as
NX_SYSDEFINEDevents (subtype 8,NX_SUBTYPE_AUX_CONTROL_BUTTONS), and Peekaboo can't post those. So a new patch,peekaboo-system-defined-key.patch, last in the stack, adds a Bridge operation,systemDefinedKey. It is modeled onmoveMouse:.postEvent) and has a global target.dispatchedUnverified.The runtime allowlist adds
systemDefinedKey. The client refuses a media key before dispatch when:Once a key is dispatched the result is always
unknown, because nothing reads back the volume, brightness or playback state. The message warns not to blindly repeatplay_pauseormute, since they toggle.The keyboard backlight keys were cheap to include (
NX_KEYTYPE_ILLUMINATION_UP/DOWN). Display brightness via these events may not reach every display, especially external ones. That is why the result staysunknown, and the docs say so.Checks
npm run checkandnpm testpass (21, on top of feat: hold modifier keys during clicks, and press key sequences against one snapshot #77). The newtest/systemkey.test.mjscovers the refusals and the tool schema.PeekabooBridgeRequestPlanTests,PeekabooBridgeOperationSemanticPlanTestsandPeekabooBridgeOperationResultSemanticsTests, 72 tests.PeekabooTests*Bridge*run did not finish within the 580 s cap. Before the cap it reported timeouts in application launch, dialog input and targeted click tests (responseLost/Operation timed out) with the screen locked. None of these use the new operation.mutereaches native and is refused before dispatch because the session is locked.