mirror of
https://github.com/safijari/openpuck.git
synced 2026-11-03 22:30:22 +00:00
[PR #87] [MERGED] Add configurable lizard-mode binding table (replaces hardcoded button map) #193
Labels
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
safijari/openpuck#193
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/safijari/openpuck/pull/87
Author: @Copilot
Created: 6/25/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @safijari
Base:
main← Head:copilot/add-remap-pure-lizard-mode-shortcuts📝 Commits (4)
9fb6539Add lizard_map binding system and rewrite mode_lizard to use it55cce32Actually working now8849c4aMerge main into lizard-map branch: reconcile lizard rewrite with multi-controller/stability rework3b37d8eMerge branch 'main' into copilot/add-remap-pure-lizard-mode-shortcuts📊 Changes
9 files changed (+817 additions, -190 deletions)
View changed files
📝
OpenPuck/OpenPuck.ino(+10 -0)➕
OpenPuck/lizard_map.cpp(+155 -0)➕
OpenPuck/lizard_map.h(+72 -0)📝
OpenPuck/mode_lizard.cpp(+207 -158)📝
OpenPuck/mode_lizard.h(+16 -12)📝
OpenPuck/puck_hid.cpp(+24 -11)📝
OpenPuck/webusb_config.cpp(+95 -8)📝
docs/PROTOCOL.md(+23 -0)📝
docs/index.html(+215 -1)📄 Description
Hardcoded button→keyboard/mouse mappings in
mode_lizard.cppcan't be user-customized. This PR replaces them with a runtime-editableLizardMaptable — laying the groundwork for both a WebUSB/browser remapping UI and future emulated-controller remapping using the same engine.New files
lizard_map.h— data model:LizardBinding(16 bytes each),LizardMap(count+ up to 32 bindings), output-type constants (LZ_OUT_KBD_CHORD,LZ_OUT_MOUSE_BTN,LZ_OUT_MOUSE_AXIS,LZ_OUT_SCROLL,LZ_OUT_CONSUMER), analog-source constants, virtual stick-deflection trigger bits (LZ_BTN_LSTICK_*, ORed in at eval time since SC2 never sets bits 28–31)lizard_map.cpp—defaultLizardMap()(26 bindings reproducing the original hardcoded behavior),saveLizardMap()/loadLizardMap()with LittleFS persistence (magic0xB1, version byte, graceful reset to defaults on mismatch)Modified files
mode_lizard.h/cpp—rfLizarddrops the rawreppointer (readsg_in[0]directly, consistent with all other modes); body replaced by a loop overg_lizardMap.bindings[]that accumulates keyboard chord, mouse button/axis, scroll, and edge-triggered consumer outputs. AkbdConsumedbitmask suppresses simpler single-button bindings when a hold-modifier combo (e.g. Steam+X) has already claimed those trigger bits.Still pending (won't compile yet)
puck_hid.cppcall site update (dropreparg)OpenPuck.inosetup:#include "lizard_map.h"+loadLizardMap()webusb_config.cpp: version 9→10, opcodes0x0D/0x0E/0x0F(GET/SET/RESET map)serial_console.cpp:'f'(dump) /'u'(reset) debug commandsdocs/index.html: "Lizard / Desktop shortcuts" binding editor card🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.