Skip to content

v0.5.0

Choose a tag to compare

@changkun changkun released this 06 Jun 15:51
· 2 commits to main since this release
f8f76b8

⚠️ Breaking changes

  • Minimum Go is now 1.24 (was 1.17). (#37, #42)
  • Key is now uint32 on all platforms (was uint8 on macOS, uint16 on Linux/Windows). Explicit narrowing casts such as uint16(key) must be updated; hotkey.KeyA and hotkey.Key(0x15) are unaffected. (#42)
  • Register/Unregister error messages were normalized across platforms (text changed). (#41)

New features

  • Media keys on all platformsKeyMediaPlayPause, KeyMediaNext, KeyMediaPrev, KeyMediaStop, KeyVolumeUp, KeyVolumeDown, KeyVolumeMute. Linux uses XF86* keysyms, Windows VK_MEDIA_*, macOS a CGEventTap. See examples/media. (#42, #43, #44)
    • macOS: media keys require Accessibility (Input Monitoring) permission; without it Register() returns an error. KeyMediaStop is not available on macOS. Normal hotkeys are unchanged and still need no permission.
  • OpenBSD (X11) support. (#36)

Fixes

  • Linux: KeyTab was aliased to KeyEscape — 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.h import 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