From f77cd55b119f9e7dc9073240009c6fe2027cc2cf Mon Sep 17 00:00:00 2001 From: Cyd Date: Mon, 6 Jul 2026 15:08:38 -0500 Subject: [PATCH] pkg: package identity so Dynamic Lighting grants background control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Settings "Background light control" list only offers apps that have BOTH package identity and the com.microsoft.windows.lighting windows.appExtension in their manifest (declaration verified against Lenovo's LegionLightingController manifest) — without a grant, Windows hands the LEDs to vRIO only while it is the foreground window, i.e. never during gameplay. pkg/AppxManifest.xml is a sparse package (external location) that grants the existing VRio.App.exe identity as-is: win32App runtime behavior, runFullTrust + unvirtualizedResources, and the lighting app-extension. Register-vRIO.ps1 registers/unregisters it against any exe folder (repo build or an extracted dist zip); unsigned registration needs Developer Mode. Identity is granted through shell activation only — launch from the Start menu entry or an AUMID taskbar pin, not by double-clicking the exe (the script prints this warning). Verified end-to-end on this machine: process reports the package full name, vRIO appears in the background-control list, and the wire log shows the withheld → available transition once granted. Co-Authored-By: Claude Fable 5 --- README.md | 21 ++++++++++--- pkg/AppxManifest.xml | 67 +++++++++++++++++++++++++++++++++++++++++ pkg/Assets/logo150.png | Bin 0 -> 789 bytes pkg/Assets/logo44.png | Bin 0 -> 229 bytes pkg/Public/README.txt | 1 + pkg/Register-vRIO.ps1 | 53 ++++++++++++++++++++++++++++++++ 6 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 pkg/AppxManifest.xml create mode 100644 pkg/Assets/logo150.png create mode 100644 pkg/Assets/logo44.png create mode 100644 pkg/Public/README.txt create mode 100644 pkg/Register-vRIO.ps1 diff --git a/README.md b/README.md index 7d90502..16b176e 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,17 @@ controls: - Cells shade to the **lamp state the host commands** (`LampRequest`: off / dim / bright, with slow/med/fast flash), so RIOJoy's press-feedback lights the on-screen panel just like the real buttons. +- **Lamps can mirror onto an RGB keyboard** (*Mirror lamps on RGB keyboard*, + via Windows 11 Dynamic Lighting): keys bound to lamp-capable buttons glow + with the panel's palette and blink in step with the on-screen flash modes; + per-key keyboards get the full button field, zone-lit keyboards show the + strongest current lamp board-wide, and a picker narrows the mirror to one + keyboard when several are attached. For the LEDs to stay lit while the + *game* has focus, vRIO needs package identity: run `pkg\Register-vRIO.ps1` + once (Developer Mode required; pass the exe folder for a deployed copy), + launch vRIO from its **Start menu entry** (a direct exe launch runs without + identity), then drag vRIO to the top of *Settings → Personalization → + Dynamic Lighting → Background light control*. - **Keyboard and Xbox (XInput) controller input** drive the same controls through a bindings file (`%APPDATA%\vRIO\bindings.txt`, created with commented defaults on first run — *Edit bindings…* opens it, *Reload @@ -60,11 +71,10 @@ device behavior grounded in the **real v4.2 firmware dump** - `ResetRequest` re-zeroes the targeted axis (or all). - A NAK re-sends the last event up to **4 times**, then gives up with a RESTART byte — the real board's retry budget. -- Optional **v4.2 reply-wedge emulation**: after retry exhaustion (or the - "Wedge analog now" button), analog requests are silently dropped — still - ACK'd, RX path alive — until a host `ResetRequest`, reproducing the - latch-leak fault the firmware analysis documents. Use it to exercise - RIOJoy's 5-second no-analog recovery watchdog. +- Optional **v4.2 reply-wedge emulation** (in `VRio.Core`; the UI toggles + were removed): after retry exhaustion, analog requests are silently + dropped — still ACK'd, RX path alive — until a host `ResetRequest`, + reproducing the latch-leak fault the firmware analysis documents. ## Using it with RIOJoy on one PC @@ -86,6 +96,7 @@ a null-modem cable work the same way. |------|----------| | `src/VRio.Core` | Protocol framing/builder/parser, the `VRioDevice` state machine, serial pump, panel layout data (class library) | | `src/VRio.App` | WinForms panel UI | +| `pkg` | Sparse-package manifest + registration script: grants VRio.App.exe the package identity Dynamic Lighting's background-control list requires | | `tests/VRio.Core.Tests` | xUnit tests for the protocol + device engine | ## Building diff --git a/pkg/AppxManifest.xml b/pkg/AppxManifest.xml new file mode 100644 index 0000000..8ac2b93 --- /dev/null +++ b/pkg/AppxManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + vRIO + VWE + Assets\logo150.png + true + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Assets/logo150.png b/pkg/Assets/logo150.png new file mode 100644 index 0000000000000000000000000000000000000000..11904c3fda5656f2ae3cac3297c78146ed35ea24 GIT binary patch literal 789 zcmeAS@N?(olHy`uVBq!ia0vp^(?FPm4M^HB7Cr(}jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qt-3{0y$T^vIy;@)0b*z3$F;CxWz(`(QFp-XzL z^X8PQWFHW4e!X|z^PkQ6)lV7jE9m%fbPFGP)Uv@skz(e@%^U3Ao3s9`?%r_h>3iKn zQq%Wu=g5xvcTZ_e;i%vc4-k9q?p!LR6Ie<+VxL}kNS%G}c0*}aI1_r*vAk26?e? Personalization > Dynamic Lighting > "Background light control", +so the keyboard lamp mirror keeps working while the game has focus. + +Unsigned registration requires Developer Mode +(Settings > System > For developers). + +.PARAMETER ExePath +Folder containing VRio.App.exe. Defaults to the repo's Release output; +for a deployed zip, pass the extracted VRio folder. + +.PARAMETER Unregister +Remove the registration instead. +#> +param( + [string]$ExePath = (Join-Path $PSScriptRoot '..\src\VRio.App\bin\Release\net48'), + [switch]$Unregister +) + +$ErrorActionPreference = 'Stop' +$packageName = 'VWE.vRIO' + +$existing = Get-AppxPackage -Name $packageName -ErrorAction SilentlyContinue +if ($existing) { + Write-Host "Removing existing registration $($existing.PackageFullName)..." + Remove-AppxPackage -Package $existing.PackageFullName +} +if ($Unregister) { + Write-Host 'Unregistered.' + return +} + +$exe = Join-Path $ExePath 'VRio.App.exe' +if (-not (Test-Path $exe)) { throw "VRio.App.exe not found in '$ExePath'" } +$manifest = Join-Path $PSScriptRoot 'AppxManifest.xml' + +Add-AppxPackage -Register $manifest -ExternalLocation (Resolve-Path $ExePath).Path +$family = (Get-AppxPackage -Name $packageName).PackageFamilyName +Write-Host "Registered $packageName with external location '$ExePath'." +Write-Host '' +Write-Host 'IMPORTANT: identity is granted through shell activation only. Launch vRIO' +Write-Host 'from the Start menu entry ("vRIO") or via:' +Write-Host " explorer shell:AppsFolder\$family!vRIO" +Write-Host 'Double-clicking VRio.App.exe runs it WITHOUT identity (lamp mirror then' +Write-Host 'works only while vRIO has focus).' +Write-Host '' +Write-Host 'Then enable the lamp mirror and pick vRIO under Settings > Personalization >' +Write-Host 'Dynamic Lighting > Background light control.'