Skip to content

[Razer] button mappings can only be mouse buttons — keyboard keys verified working on the Viper Mini #349

Backlog

Description

@snekxs

Follow-up to #342, from the same reporter's Viper Mini (1532:008a, firmware v1.3).

#342 closed the gap where the Viper Mini had no Buttons tab at all. It now reports the four RazerButtonControls and they remap to mouse buttons — but RAZER_BUTTON_MAPPINGS only contains Left Click, Right Click, Mouse Button 4, Mouse Button 5 and Disabled, so a user cannot assign a keyboard key to a side button. That is the actual ask from the report: "I can't bind keys."

The firmware already does it

Measured on the reporter's mouse, read back through 0x02/0x8c with [profile, control, layer]:

00 60 00 | 02 02 00 73    DPI button, Standard layer → keyboard key, no modifier, usage 0x73 (F24)

and a write of the same shape on the Hypershift layer took effect physically: back/forward set to keyboard actions produced real F13/F14 key events in wev, confirmed after a replug. So the encoding is verified on hardware — type=0x02, len=0x02, <modifier byte>, <HID usage>, with the same modifier bits the driver already uses elsewhere (ctrl 0x01, shift 0x02, alt 0x04, meta 0x08, …).

What it would take

  1. Codec: widen the mapping type beyond the five mouse labels. Something like a RazerButtonMapping that can also be { mods, usage }, encoding to [0x02, 0x02, mods, usage]; the decoder needs the mirror so a keyboard assignment reads back as itself rather than null (today it returns null for type 0x02, which is why an assigned key would silently vanish from the panel).
  2. Driver: no change — setButtonMapping already ships whatever the codec builds, and this firmware confirms by read-back.
  3. App: the dropdown would need a "Keyboard shortcut" entry plus a key-capture row, which is the bulk of the work and lives in openmouse.

Open questions before anyone builds it

  • Whether the read-back for a keyboard mapping on other Razer models matches this one — only this Viper Mini has been checked.
  • Whether every HID usage in the consumer range is accepted, or the firmware rejects some, which the write silently storing anything makes hard to detect without a press test.

Protocol credit for the capture: the reporter (sapphired.) on Arch.

Activity

  1. snekxs commented on Dec 4, 2026

    @snekxs
    MemberAuthor

    Implemented and verified on hardware in this reporter's Viper Mini: keyboard mappings write [profile, control, layer, 0x02, 0x02, mods, usage], read back as themselves (so a key shows in the panel instead of vanishing), and are labelled Ctrl+F13-style. Codec and driver are in #348; the key-capture row in the panel is OpenMouse-Project/openmouse#1788. Confirmed live: Mouse Button 5 → Ctrl+C and → Q both stored and stayed after replug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions