v0.5.0
⚠️ Breaking changes
- Minimum Go is now 1.24 (was 1.17). (#37, #42)
Keyis nowuint32on all platforms (wasuint8on macOS,uint16on Linux/Windows). Explicit narrowing casts such asuint16(key)must be updated;hotkey.KeyAandhotkey.Key(0x15)are unaffected. (#42)- Register/Unregister error messages were normalized across platforms (text changed). (#41)
New features
- Media keys on all platforms —
KeyMediaPlayPause,KeyMediaNext,KeyMediaPrev,KeyMediaStop,KeyVolumeUp,KeyVolumeDown,KeyVolumeMute. Linux usesXF86*keysyms, WindowsVK_MEDIA_*, macOS aCGEventTap. Seeexamples/media. (#42, #43, #44)- macOS: media keys require Accessibility (Input Monitoring) permission; without it
Register()returns an error.KeyMediaStopis not available on macOS. Normal hotkeys are unchanged and still need no permission.
- macOS: media keys require Accessibility (Input Monitoring) permission; without it
- OpenBSD (X11) support. (#36)
Fixes
- Linux:
KeyTabwas aliased toKeyEscape— corrected to the proper keysym. (#35) - Linux: hotkeys now fire regardless of NumLock/CapsLock state. (#39)
- Linux:
Unregister()now interrupts the X11 event loop instead of waiting for the next keypress (fixes a freeze on unregister). (#38) - Linux: registering a combination already grabbed by another application now returns an error instead of crashing the process. (#40)
- macOS: fixed the
dispatch.himport on case-sensitive filesystems. (#31) - Windows: improved KeyDown/KeyUp detection. (#23)
Internal
- Modernized CI:
actions/checkout@v4/setup-go@v5, Go 1.24 + stable, arm64 runners (Linux/macOS/Windows), a CGO cross-build sweep, and an OpenBSD VM job. (#37)
Full changelog: v0.4.1...v0.5.0