LizardByte / LizardByte/Sunshine
Windows: Corruption of volume keys remapping by keybindings
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 41.3k
- Forks
- 2.1k
- Avg merge
- 23h 47m
- Merged PRs (30d)
- 124
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your issue described in the documentation?
- [x] I have read the documentation
### Is your issue present in the latest beta/pre-release?
This issue is present in the latest pre-release
### Describe the Bug
Given the following configuration on Sunshine v2026.412.25828, `VK_VOLUME_DOWN` and `VK_VOLUME_UP` will be rewritten to the wrong keycodes on the server side of the connection:
```
keybindings = [
0x80, 0xAE,
0x81, 0xAF
]
```
The keys above were directly verified, but the underlying issue impacts all extended keys that are not currently receiving special handling.
### Expected Behavior
The keycodes seen by the serverside OS match the mappings placed into the configuration file.
### Additional Context
For background, this started as a side project to get the volume wheel on my keyboard to control the system running Sunshine. The volume wheel itself can't be hooked from the OS by Moonlight for well-documented reasons. Instead, I opted to use the VIA firmware on my keyboard to map the volume wheel to two unused keys (F17 and F18) when the FN key was being held. If those keys successfully traverse the client side and arrive at the Sunshine server, I could then remap those to volume keys on the remote side and have a volume wheel that controls both computers.
That was the idea, anyway. Once I implemented the `keybindings` remap on the remote side, it quickly became clear that the keys were being successfully mapped to _something_ but not the intended keys. Time to use a throwaway Powershell snippet to read keycodes.
```
Add-Type -AssemblyName System.Windows.Forms
$form = New-Object System.Windows.Forms.Form
$form.Text = "Key Inspector"
$form.Width = 400
$form.Height = 200
$label = New-Object System.Windows.Forms.Label
$label.Dock = "Fill"
$label.Font = New-Object System.Drawing.Font("Consolas", 14)
$label.TextAlign = "MiddleCenter"
$form.Controls.Add($label)
$form.Add_KeyDown({
$label.Text = "VK: 0x{0:X2} ({1})`nKey: {2}" -f [int]$_.KeyCode, [int]$_.KeyCode, $_.KeyCode
})
$form.KeyPreview = $true
[System.Windows.Forms.Application]::Run($form)
```
My local F17 and F18 keypresses were translated to 0x43 (C) and 0x42 (B). Removing the `keybindings` section and restarting Sunshine caused the keys to revert to 0x80 (F17) and 0x81 (F18). Reapplying the `keybindings` section and restarting Sunshine a third time yielded the exact same problem.
| Local key | VIA mapping | sunshine.conf mapping | Powershell sees |
|-----------------|-------------|-------------------------|-----------------|
| fn + wheel down | F17 (0x80) | 0xAE (Volume Down) | C (0x43) |
| fn + wheel up | F18 (0x81) | 0xAF (Volume Up) | B (0x42) |
This ruled out the client side, confirmed that F17 and F18 were traversing to the remote side, and confirmed that Sunshine was attaching to the 0x80 and 0x81 keys in the `keybindings` section. That narrows the problem scope to what the keys are being rewritten to. The fact that ascending keys (0xAE->0xAF) were being rewritten to descending keys (0x43->0x42) also stood out.
Now, enter the jackass. "Pretty cut and dry keycode corruption. Let's have Claude Code identify the line numbers, produce a table of impacted keys, and toss a bug report at the issues API for Sunshine. I'm sure the developers will be delighted to sift through a submission that ignores their form alongside the rest of the AI slop they've been buried with lately." That would be #4978. I'm not going to insult the team's intelligence further and repaste the AI dissection here; if you would find the line counts useful, they're there. If not, you've got the user impressions and full repro here.
The correct thing to do would have been to file this exact ticket, and then provide the analysis at the bottom where it is sectioned off. I apologize for callously disrespecting the time of the team at the convenience of myself.
### Host Operating System
Windows
### Operating System Version
Windows 11 Pro (Build 26200)
### Architecture
amd64/x86_64
### Package
Windows - msi installer (recommended)
### GPU Type
n/a
### GPU Model
N/A
### GPU Driver/Mesa Version
N/A
### Capture Method
None
### Apps
```json
```
### Log output
```shell
[2026-04-12 17:32:29.856]: Info: Sunshine version: 2026.412.25828 commit: ba1f3bba3a5cc98a2db12c25569020e32b962cd2
[2026-04-12 17:32:29.856]: Info: Package Publisher: LizardByte
[2026-04-12 17:32:29.856]: Info: Publisher Website: https://app.lizardbyte.dev
[2026-04-12 17:32:29.856]: Info: Get support: https://app.lizardbyte.dev/support
[2026-04-12 17:32:29.856]: Info: config: 'nvenc_opengl_vulkan_on_dxgi' = disabled
[2026-04-12 17:32:29.856]: Info: config: 'stream_audio' = false
[2026-04-12 17:32:29.856]: Info: config: 'keybindings' = [
0x80, 0xAE,
0x81, 0xAF
]
[2026-04-12 17:32:29.856]: Info: Provided workaround settings for SettingsManager:
{
"hdr_blank_delay": null
}
[2026-04-12 17:32:29.858]: Info: Currently available display devices:
[
{
"device_id": "{d7fe8b51-6cba-5313-a1d2-5f2ffe7c8de7}",
"display_name": "\\\\.\\DISPLAY1",
"edid": {
"manufacturer_id": "PHL",
"product_code": "C29E",
"serial_number": 1010101
},
"friendly_name": "PHL 42M2N8900",
"info": {
"hdr_state": "Disabled",
"origin_point": {
"x": 0,
"y": 0
},
"primary": true,
"refresh_rate": {
"type": "rational",
"value": {
"denominator": 1,
"numerator": 120
}
},
"resolution": {
"height": 2160,
"width": 3840
},
"resolution_scale": {
"type": "rational",
"value": {
"denominator": 100,
"numerator": 200
}
}
}
}
]
[2026-04-12 17:32:29.992]: Info: nvprefs: No need to modify application profile settings
[2026-04-12 17:32:29.992]: Info: nvprefs: No need to modify global profile settings
[2026-04-12 17:32:30.010]: Info: Compiling shaders...
[2026-04-12 17:32:30.081]: Info: Compiled shaders
[2026-04-12 17:32:30.092]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2026-04-12 17:32:30.092]: Info: Trying encoder [nvenc]
[2026-04-12 17:32:30.454]: Info:
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID : 0x000010DE
Device Device ID : 0x00002684
Device Video Mem : 24138 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 32365 MiB
Feature Level : 0x0000B100
Capture size : 3840x2160
Offset : 0x0
Virtual Desktop : 3840x2160
[2026-04-12 17:32:30.455]: Info: Active GPU has HAGS enabled
[2026-04-12 17:32:30.455]: Info: Using realtime GPU priority
[2026-04-12 17:32:30.455]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.674805,0.323242]
Green Primary : [0.263672,0.675781]
Blue Primary : [0.144531,0.0498047]
White Point : [0.28125,0.288086]
Min Luminance : 0 nits
Max Luminance : 417.712 nits
Max Full Luminance : 417.712 nits
[2026-04-12 17:32:30.457]: Info: Desktop resolution [3840x2160]
[2026-04-12 17:32:30.457]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-04-12 17:32:30.457]: Info: Display refresh rate [120Hz]
[2026-04-12 17:32:30.457]: Info: Requested frame rate [60/1 exactly 60 fps]
[2026-04-12 17:32:30.457]: Info: Creating encoder [h264_nvenc]
[2026-04-12 17:32:30.457]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:30.457]: Info: Color depth: 8-bit
[2026-04-12 17:32:30.457]: Info: Color range: JPEG
[2026-04-12 17:32:30.507]: Info: NvEnc: created encoder H.264 P1 async two-pass rfi
[2026-04-12 17:32:30.531]: Info: Creating encoder [hevc_nvenc]
[2026-04-12 17:32:30.531]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:30.531]: Info: Color depth: 8-bit
[2026-04-12 17:32:30.531]: Info: Color range: JPEG
[2026-04-12 17:32:30.577]: Info: NvEnc: created encoder HEVC P1 async two-pass rfi
[2026-04-12 17:32:30.599]: Info: Creating encoder [av1_nvenc]
[2026-04-12 17:32:30.599]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:30.599]: Info: Color depth: 8-bit
[2026-04-12 17:32:30.599]: Info: Color range: JPEG
[2026-04-12 17:32:30.644]: Info: NvEnc: created encoder AV1 P1 async two-pass rfi
[2026-04-12 17:32:30.665]: Info: Creating encoder [h264_nvenc]
[2026-04-12 17:32:30.665]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:30.665]: Info: Color depth: 8-bit
[2026-04-12 17:32:30.665]: Info: Color range: JPEG
[2026-04-12 17:32:30.710]: Info: NvEnc: created encoder H.264 P1 async yuv444 two-pass rfi
[2026-04-12 17:32:30.967]: Info:
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID : 0x000010DE
Device Device ID : 0x00002684
Device Video Mem : 24138 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 32365 MiB
Feature Level : 0x0000B100
Capture size : 3840x2160
Offset : 0x0
Virtual Desktop : 3840x2160
[2026-04-12 17:32:30.967]: Info: Active GPU has HAGS enabled
[2026-04-12 17:32:30.967]: Info: Using realtime GPU priority
[2026-04-12 17:32:30.967]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.674805,0.323242]
Green Primary : [0.263672,0.675781]
Blue Primary : [0.144531,0.0498047]
White Point : [0.28125,0.288086]
Min Luminance : 0 nits
Max Luminance : 417.712 nits
Max Full Luminance : 417.712 nits
[2026-04-12 17:32:30.969]: Info: Desktop resolution [3840x2160]
[2026-04-12 17:32:30.969]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-04-12 17:32:30.969]: Info: Display refresh rate [120Hz]
[2026-04-12 17:32:30.969]: Info: Requested frame rate [60/1 exactly 60 fps]
[2026-04-12 17:32:30.969]: Info: Creating encoder [hevc_nvenc]
[2026-04-12 17:32:30.969]: Info: Color coding: SDR (Rec. 709)
[2026-04-12 17:32:30.969]: Info: Color depth: 10-bit
[2026-04-12 17:32:30.969]: Info: Color range: JPEG
[2026-04-12 17:32:31.091]: Info: NvEnc: created encoder HEVC P1 async yuv444 10-bit two-pass rfi
[2026-04-12 17:32:31.134]: Info: Creating encoder [av1_nvenc]
[2026-04-12 17:32:31.134]: Info: Color coding: SDR (Rec. 709)
[2026-04-12 17:32:31.134]: Info: Color depth: 10-bit
[2026-04-12 17:32:31.134]: Info: Color range: JPEG
[2026-04-12 17:32:31.216]: Error: NvEnc: gpu doesn't support YUV444 encode
[2026-04-12 17:32:31.216]: Error: NvEnc: NvEncUnregisterAsyncEvent() failed: NV_ENC_ERR_DEVICE_NOT_EXIST
[2026-04-12 17:32:31.240]: Info: Creating encoder [av1_nvenc]
[2026-04-12 17:32:31.240]: Info: Color coding: SDR (Rec. 709)
[2026-04-12 17:32:31.240]: Info: Color depth: 10-bit
[2026-04-12 17:32:31.240]: Info: Color range: JPEG
[2026-04-12 17:32:31.289]: Info: NvEnc: created encoder AV1 P1 async 10-bit two-pass rfi
[2026-04-12 17:32:31.321]: Info:
[2026-04-12 17:32:31.321]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2026-04-12 17:32:31.321]: Info:
[2026-04-12 17:32:31.321]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2026-04-12 17:32:31.321]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2026-04-12 17:32:31.321]: Info: Found AV1 encoder: av1_nvenc [nvenc]
[2026-04-12 17:32:31.321]: Info: Starting system tray
[2026-04-12 17:32:31.321]: Info: System tray thread initialized successfully
[2026-04-12 17:32:31.321]: Info: No main thread features enabled, skipping event loop
[2026-04-12 17:32:31.321]: Info: System tray thread started
[2026-04-12 17:32:31.324]: Info: Configuration UI available at [https://localhost:47990]
[2026-04-12 17:32:31.344]: Info: System tray created
[2026-04-12 17:32:32.102]: Info: Registered Sunshine mDNS service
[2026-04-12 17:32:35.441]: Info: Encoder reenumeration is required
[2026-04-12 17:32:35.441]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2026-04-12 17:32:35.441]: Info: Trying encoder [nvenc]
[2026-04-12 17:32:35.679]: Info:
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID : 0x000010DE
Device Device ID : 0x00002684
Device Video Mem : 24138 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 32365 MiB
Feature Level : 0x0000B100
Capture size : 3840x2160
Offset : 0x0
Virtual Desktop : 3840x2160
[2026-04-12 17:32:35.680]: Info: Active GPU has HAGS enabled
[2026-04-12 17:32:35.680]: Info: Using realtime GPU priority
[2026-04-12 17:32:35.680]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.674805,0.323242]
Green Primary : [0.263672,0.675781]
Blue Primary : [0.144531,0.0498047]
White Point : [0.28125,0.288086]
Min Luminance : 0 nits
Max Luminance : 417.712 nits
Max Full Luminance : 417.712 nits
[2026-04-12 17:32:35.682]: Info: Desktop resolution [3840x2160]
[2026-04-12 17:32:35.682]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-04-12 17:32:35.682]: Info: Display refresh rate [120Hz]
[2026-04-12 17:32:35.682]: Info: Requested frame rate [60/1 exactly 60 fps]
[2026-04-12 17:32:35.682]: Info: Creating encoder [h264_nvenc]
[2026-04-12 17:32:35.682]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:35.682]: Info: Color depth: 8-bit
[2026-04-12 17:32:35.682]: Info: Color range: JPEG
[2026-04-12 17:32:35.724]: Info: NvEnc: created encoder H.264 P1 async two-pass rfi
[2026-04-12 17:32:35.746]: Info: Creating encoder [hevc_nvenc]
[2026-04-12 17:32:35.746]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:35.746]: Info: Color depth: 8-bit
[2026-04-12 17:32:35.746]: Info: Color range: JPEG
[2026-04-12 17:32:35.787]: Info: NvEnc: created encoder HEVC P1 async two-pass rfi
[2026-04-12 17:32:35.810]: Info: Creating encoder [av1_nvenc]
[2026-04-12 17:32:35.810]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:35.810]: Info: Color depth: 8-bit
[2026-04-12 17:32:35.810]: Info: Color range: JPEG
[2026-04-12 17:32:35.851]: Info: NvEnc: created encoder AV1 P1 async two-pass rfi
[2026-04-12 17:32:35.873]: Info: Creating encoder [h264_nvenc]
[2026-04-12 17:32:35.873]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:35.873]: Info: Color depth: 8-bit
[2026-04-12 17:32:35.873]: Info: Color range: JPEG
[2026-04-12 17:32:35.917]: Info: NvEnc: created encoder H.264 P1 async yuv444 two-pass rfi
[2026-04-12 17:32:36.175]: Info:
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID : 0x000010DE
Device Device ID : 0x00002684
Device Video Mem : 24138 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 32365 MiB
Feature Level : 0x0000B100
Capture size : 3840x2160
Offset : 0x0
Virtual Desktop : 3840x2160
[2026-04-12 17:32:36.175]: Info: Active GPU has HAGS enabled
[2026-04-12 17:32:36.176]: Info: Using realtime GPU priority
[2026-04-12 17:32:36.176]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.674805,0.323242]
Green Primary : [0.263672,0.675781]
Blue Primary : [0.144531,0.0498047]
White Point : [0.28125,0.288086]
Min Luminance : 0 nits
Max Luminance : 417.712 nits
Max Full Luminance : 417.712 nits
[2026-04-12 17:32:36.177]: Info: Desktop resolution [3840x2160]
[2026-04-12 17:32:36.177]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-04-12 17:32:36.177]: Info: Display refresh rate [120Hz]
[2026-04-12 17:32:36.177]: Info: Requested frame rate [60/1 exactly 60 fps]
[2026-04-12 17:32:36.178]: Info: Creating encoder [hevc_nvenc]
[2026-04-12 17:32:36.178]: Info: Color coding: SDR (Rec. 709)
[2026-04-12 17:32:36.178]: Info: Color depth: 10-bit
[2026-04-12 17:32:36.178]: Info: Color range: JPEG
[2026-04-12 17:32:36.289]: Info: NvEnc: created encoder HEVC P1 async yuv444 10-bit two-pass rfi
[2026-04-12 17:32:36.331]: Info: Creating encoder [av1_nvenc]
[2026-04-12 17:32:36.331]: Info: Color coding: SDR (Rec. 709)
[2026-04-12 17:32:36.331]: Info: Color depth: 10-bit
[2026-04-12 17:32:36.331]: Info: Color range: JPEG
[2026-04-12 17:32:36.407]: Error: NvEnc: gpu doesn't support YUV444 encode
[2026-04-12 17:32:36.407]: Error: NvEnc: NvEncUnregisterAsyncEvent() failed: NV_ENC_ERR_DEVICE_NOT_EXIST
[2026-04-12 17:32:36.430]: Info: Creating encoder [av1_nvenc]
[2026-04-12 17:32:36.430]: Info: Color coding: SDR (Rec. 709)
[2026-04-12 17:32:36.430]: Info: Color depth: 10-bit
[2026-04-12 17:32:36.430]: Info: Color range: JPEG
[2026-04-12 17:32:36.482]: Info: NvEnc: created encoder AV1 P1 async 10-bit two-pass rfi
[2026-04-12 17:32:36.516]: Info:
[2026-04-12 17:32:36.517]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2026-04-12 17:32:36.517]: Info:
[2026-04-12 17:32:36.517]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2026-04-12 17:32:36.517]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2026-04-12 17:32:36.517]: Info: Found AV1 encoder: av1_nvenc [nvenc]
[2026-04-12 17:32:36.517]: Info: Executing [Desktop]
[2026-04-12 17:32:36.551]: Info: New streaming session started [active sessions: 1]
[2026-04-12 17:32:36.693]: Info: nvprefs: No need to modify application profile settings
[2026-04-12 17:32:36.693]: Info: nvprefs: No need to modify global profile settings
[2026-04-12 17:32:36.728]: Info: CLIENT CONNECTED
[2026-04-12 17:32:37.101]: Info:
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID : 0x000010DE
Device Device ID : 0x00002684
Device Video Mem : 24138 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 32365 MiB
Feature Level : 0x0000B100
Capture size : 3840x2160
Offset : 0x0
Virtual Desktop : 3840x2160
[2026-04-12 17:32:37.102]: Info: Active GPU has HAGS enabled
[2026-04-12 17:32:37.102]: Info: Using realtime GPU priority
[2026-04-12 17:32:37.102]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.674805,0.323242]
Green Primary : [0.263672,0.675781]
Blue Primary : [0.144531,0.0498047]
White Point : [0.28125,0.288086]
Min Luminance : 0 nits
Max Luminance : 417.712 nits
Max Full Luminance : 417.712 nits
[2026-04-12 17:32:37.104]: Info: Desktop resolution [3840x2160]
[2026-04-12 17:32:37.104]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-04-12 17:32:37.104]: Info: Display refresh rate [120Hz]
[2026-04-12 17:32:37.104]: Info: Requested frame rate [60fps]
[2026-04-12 17:32:37.104]: Info: Creating encoder [hevc_nvenc]
[2026-04-12 17:32:37.104]: Info: Color coding: SDR (Rec. 601)
[2026-04-12 17:32:37.104]: Info: Color depth: 10-bit
[2026-04-12 17:32:37.104]: Info: Color range: MPEG
[2026-04-12 17:32:37.122]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-04-12 17:32:37.155]: Info: NvEnc: created encoder HEVC P1 async 10-bit two-pass rfi
[2026-04-12 17:32:37.156]: Info: Minimum FPS target set to ~30fps (33.3333ms)
[2026-04-12 17:32:38.388]: Info: Gamepad 0 will be Xbox 360 controller (auto-selected by client-reported type)
[2026-04-12 17:32:38.390]: Info: Gamepad 1 will be Xbox 360 controller (auto-selected by client-reported type)
```
### Online logs
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the server-side handling of the keybindings configuration on Windows, using the 0x80/0x81 to 0xAE/0xAF reproduction as the guide. Verify the resulting keycodes with the PowerShell key inspector and consider the issue complete when extended keys reach the server OS with the configured mappings unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100