Linux keyboard backend has no mapping for VK_ABNT_C1 (ABNT2 dedicated `/ ?` key) — key is silently dropped

Abierto Apto para principiantes
#6,051 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp, linux
Área
backend

Línea de trabajo

Lee src/platform/linux/uhid_backend.cpp de libvirtualhid y localiza la tabla special_keys de key_code_to_linux(); compara la asignación de Linux con src/platform/windows/keylayout.hpp y la asignación sugerida a KEY_RO. Comprueba si es necesario gestionar VK_ABNT_C2 mientras editas. Se considera terminado cuando VK_ABNT_C1 se asigna a KEY_RO y el backend de Linux lo acepta; el cambio relacionado en el cliente Moonlight se describe en moonlight-qt#1944.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Is this a new bug?
  • I have searched existing issues and this has not been reported before (no ABNT/ABNT_C1 results in LizardByte/Sunshine or LizardByte/libvirtualhid).
Describe the bug

The dedicated / ? key of a Brazilian ABNT2 keyboard is dropped on Linux hosts. Windows maps this key to the Brazil-specific VK_ABNT_C1 (0xC1, scan code 0x73), but Sunshine's Linux keyboard path has no mapping for it, so pressing the key types nothing regardless of the host's keyboard layout.

All other ABNT2 keys round-trip correctly once the host session layout is br (ABNT2) — only this key is lost.

Expected behavior

VK_ABNT_C1 should reach the host and produce / (? with Shift) when the host layout is ABNT2, the same way Windows hosts already handle it.

System File Check output
Current Directory: /home/machadex/.config/sunshine
Version: 2026.1103.235308 (commit: 019b1ba)
OS: CachyOS (Arch-based), Linux, KDE Plasma 6.8.2 on Wayland
GPU: NVIDIA (nvenc), capture: kwin
Details / evidence

Client: Moonlight for Windows (current stable), ABNT2 keyboard; host: Sunshine 2026.1103.235308.

  1. Official Windows layout — KBDBR.DLL (Portuguese Brazil ABNT2, via kbdlayout.info KBDTABLES dump) assigns:

    • ;/: → scan 0x35, VK_OEM_2 (0xBF)
    • \/| → scan 0x56, VK_OEM_102 (0xE2)
    • //? → scan 0x73, VK_ABNT_C1 (0xC1) ← the affected key
  2. Linux conversion table — key_code_to_linux() in libvirtualhid src/platform/linux/uhid_backend.cpp holds a fixed 48-pair table of US positions and has no 0xC1 entry (sequence: 0xBF→53 KEY_SLASH, 0xC0→41 KEY_GRAVE, then directly 0xDB→26). Verified both in master source and in the shipped binary (the pair<u32,u32> array at file offset 0x2c3a1a0 of /usr/bin/sunshine 2026.1103). Unmapped codes return -1 → "keyboard key code is not supported by the Linux backend".

  3. Windows backend already handles the key — libvirtualhid src/platform/windows/keylayout.hpp contains 115, /* 0xc1 */ (scan 0x73), so Windows hosts accept it. The gap is Linux-only.

Suggested fix

Add to the Linux special_keys table:

{0xC1, KEY_RO},   // VK_ABNT_C1 — ABNT2 dedicated slash key

KEY_RO (evdev 89) is the kernel code of the ABNT2 extra slash key — XKB <AB11> (keycode 97), which symbols/br maps to [slash, question, degree, questiondown]. On non-ABNT2 host layouts it lands on an unmapped position, exactly like other layout-specific extra keys. Consider VK_ABNT_C2 (0xC2) as well while touching this.

Related upstream

For the key to work end-to-end, the client also needs to start sending it: Moonlight for Windows currently discards the key before it hits the wire — confirmed with min_log_level = debug on Sunshine (no keyboard packet at all when pressing it). moonlight-stream/moonlight-qt#1789 reports that and PR moonlight-stream/moonlight-qt#1944 fixes it. Once that lands, Linux hosts will deliver 0xC1 into the unmapped table above — this fix is the second half.

Workaround

With the host layout set to br, AltGr+Q produces / and AltGr+W produces ? (level-3 mappings in symbols/br).

Lenguaje dominante
C++
Estrellas
43k
Forks
2.4k
Merge medio
1 d 13 h
PR fusionados (30 d)
111

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de LizardByte/Sunshine

Todos los issues de LizardByte/Sunshine

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.