Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ linters:

exclusions:
rules:
# Key.String() — large switch is the standard Go pattern for enum stringers
# (same as net/http status codes, syscall signal names, etc.)
- path: events\.go
text: "cyclomatic complexity"
linters:
- gocyclo
- cyclop
- path: events\.go
text: "cognitive complexity"
linters:
- gocognit
- path: events\.go
text: "Function name: String"
linters:
- maintidx
- path: events\.go
text: "Function 'String'"
linters:
- funlen

# Test files - allow more flexibility
- path: _test\.go
linters:
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.26.0] - 2026-08-10

### Changed

- **Key enum redesign** — flat `iota` (94 keys) replaced with **grouped explicit bases** (138 keys). Each group has its own `const` block with reserved gaps, following the `net/http` status code pattern. Adding keys within a group never shifts values in other groups — binary-stable for v1.0+.
- **New groups:** Media (5 keys), Volume (3), Browser (5), System (4)
- **Extended:** Function keys F13-F24 (12 new), Punctuation +IntlBackslash/IntlYen, Numpad +NumpadEqual/NumpadComma
- **New keys:** `KeyContextMenu`, `KeyCancel`, `KeyLaunchApp1`, `KeyLaunchApp2`, `KeyMediaPlayPause`, `KeyMediaStop`, `KeyMediaTrackNext`, `KeyMediaTrackPrevious`, `KeyMediaRecord`, `KeyAudioVolumeUp`, `KeyAudioVolumeDown`, `KeyAudioVolumeMute`, `KeyBrowserBack`, `KeyBrowserForward`, `KeyBrowserRefresh`, `KeyBrowserHome`, `KeyBrowserSearch`
- **Naming:** W3C UIEvents KeyboardEvent.code convention adapted to Go PascalCase
- **BREAKING:** Key numeric values changed (pre-v1.0, no external consumers store numeric values)

### Added

- **`KeyFromString`** function — thread-safe reverse lookup from string name to Key value. Enables W3C KeyboardEvent.code compatibility for browser/WASM platforms. Uses `sync.Once` initialization. Round-trips with `Key.String()`.
- **`Key.String()`** method — covers all 138 keys with human-readable names

## [0.25.0] - 2026-08-09

### Added
Expand Down
Loading
Loading