Menu

#263 Shift+Down opens the Alt-M ANSI Music picker (keycode collision)

1.9
closed
keyboard (3)
Wayland
1.10a
1 day ago
6 days ago
No

On the native Wayland backend, pressing Shift+Down while connected pops up the ANSI Music Setup ("ANSI music mode picker") menu. Reproduces with both the dedicate Down arrow and numpad-2 (NumLock off). X11/SDL builds are unaffected.

Cause: Shift+Down and Alt-M encode to the same 16-bit keyval, 0x3200.

  • CIO_KEY_SHIFT_DOWN is (0x32 << 8) = 0x3200 (ciolib.h).
  • Alt-M is scancode 0x32 ('M') << 8 = 0x3200; the Wren layer binds Key.altM (0x3200) -> MusicMenu.run() in scripts/auto/connected/keys_default.wren.

The Wren onKey hook dispatches on the raw keyval, so any source of 0x3200 triggers the music picker.

Why Wayland specifically: conio/wl_events.c ScanCodes[] row "key 80 - cursor down" is { 0x5000, 0x3200, 0x9100, 0xa000 } — its Shift column is 0x3200, and send_scancode() emits ScanCodes[80].shift verbatim on Shift+Down. The SDL backend collapses the shifted arrow instead: conio/sdl_con.c SDLK_DOWN row is { 0x5000, 0x5000, 0x9100, 0xa000 } (base and Shift columns both 0x5000), so it never produces 0x3200. The Wayland table faithfully assigning CIO_KEY_SHIFT_DOWN is what surfaced the long-standing Shift-arrow / Alt-letter scancode aliasing, now that Alt-M has an active binding (it moved to Wren in the 1.10 cycle).

The same aliasing exists for the other shifted arrows/nav keys whose CIO_KEY_SHIFT_* value equals a bound Alt-letter keyval; Down/Alt-M is just the one with a visible in-session binding today.

Suggested fix: match the SDL backend and drop the distinct shifted-navigation keyvals in the Wayland ScanCodes[] rows (set the Shift column equal to base for the cursor/nav keys), so Shift+arrow behaves as plain arrow rather than emitting an Alt-* alias — removing the collision and making the two backends consistent.

Discussion

  • Stephen James Hurd

    • Milestone: 1.10 --> 1.9
     
  • Stephen James Hurd

    • status: open --> closed
     
  • Stephen James Hurd

    Fixed.

     

Anonymous
Anonymous

Add attachments
Cancel





Auth0 Logo