Skip to content

feat!: Key enum redesign — grouped bases, 138 keys, KeyFromString - #26

Merged
kolkov merged 1 commit into
mainfrom
feat/key-enum-redesign
Aug 10, 2026
Merged

feat!: Key enum redesign — grouped bases, 138 keys, KeyFromString#26
kolkov merged 1 commit into
mainfrom
feat/key-enum-redesign

Conversation

@kolkov

@kolkov kolkov commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Key enum redesign: flat iota (94 keys) → grouped explicit bases (138 keys)
  • 12 grouped const blocks with reserved gaps (net/http pattern)
  • 44 new keys: F13-F24, Media, Volume, Browser, System, International
  • KeyFromString() thread-safe reverse lookup (sync.Once)
  • W3C UIEvents naming convention

BREAKING

Key numeric values changed. Pre-v1.0 — no external consumers store numeric values. This is the last chance to renumber before v1.0 stability commitment.

Enterprise references

  • SDL3: USB HID explicit values
  • Qt6: hex grouped explicit values (0x01000000+ prefix)
  • Flutter: USB HID code-generated
  • Go net/http: explicit grouped values (100, 200, 300...)
  • All use explicit values with grouping. None use flat sequential.

Test plan

  • go test ./... — 87 tests pass
  • golangci-lint run — 0 issues
  • Cross-platform build (linux, darwin)
  • Downstream: gogpu builds clean
  • Key group boundaries verified (no overlap)
  • String ↔ KeyFromString round-trip for all 138 keys

…tring

BREAKING: Key numeric values changed (grouped bases replace flat iota).
Pre-v1.0 — no external consumers store numeric values.

- 12 grouped const blocks with reserved gaps (net/http pattern)
- 44 new keys: F13-F24, Media, Volume, Browser, System, Intl
- KeyFromString() thread-safe reverse lookup (sync.Once)
- String() for all 138 keys
- W3C UIEvents naming convention
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.33110% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
events.go 99.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@kolkov
kolkov merged commit 7ff1edb into main Aug 10, 2026
10 checks passed
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.

1 participant