Skip to content

Feature/hid layout tables#69

Open
yajatnarayan wants to merge 1 commit into
HighCodeh:devfrom
yajatnarayan:feature/hid-layout-tables
Open

Feature/hid layout tables#69
yajatnarayan wants to merge 1 commit into
HighCodeh:devfrom
yajatnarayan:feature/hid-layout-tables

Conversation

@yajatnarayan

@yajatnarayan yajatnarayan commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

Replace the per-layout type_string_us/_abnt2 switch functions with pure data tables and a single generic walker. Each layout is a 128-entry ASCII table of {keycode, modifier, dead_keycode, dead_modifier} entries plus an optional UTF-8 supplemental table; dead keys (ABNT2 accents, '/") are encoded as an optional prefix press. Dispatch is now a singles_layouts[] lookup indexed by ducky_layout_t, so adding a layout needs no new code path.

Output for US and ABNT2 is unchanged. Update the component README to document the new model and the "register a layout" steps.

Related Issue: Fixes #64


Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings during build.
  • I have tested this change on physical hardware. (Please specify which target below)

Hardware Testing Details

N/A

@yajatnarayan yajatnarayan force-pushed the feature/hid-layout-tables branch from 4d0a32d to 90fa3f1 Compare June 4, 2026 23:39
Replace the per-layout hid_layouts_type_string_us/_abnt2 switch functions
with data tables and a single generic walker. Each layout is a 128-entry
ASCII table of {keycode, modifier, dead_keycode, dead_modifier} entries,
plus an optional UTF-8 supplemental table for accented characters. Dead
keys (ABNT2 accents, ' and ") are encoded as an optional prefix press.
Dispatch is a single s_layouts[] lookup indexed by ducky_layout_t, so
adding a layout needs no new code path.

Typed output for US and ABNT2 is unchanged. Update the component README
and add a host-side equivalence test under tools/hid_layouts_equiv_test.
@yajatnarayan yajatnarayan force-pushed the feature/hid-layout-tables branch from 90fa3f1 to ab11d71 Compare June 4, 2026 23:44
@anarchyysm

Copy link
Copy Markdown
Member

Are you sending source files into /tools? I didn't quite understand the reason

@yajatnarayan

Copy link
Copy Markdown
Contributor Author

That's just to keep a copy of the older version just to have a side by side comparison of functionality

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants