soffes / HotKey

Simple global shortcuts in macOS
MIT License
921 stars 82 forks source link

Volume keys (.volumeUp and .volumeDown) do not work #37

Open GameParrot opened 2 years ago

GameParrot commented 2 years ago

When listening for a volume keypress (.volumeUp or .volumeDown) using

let hotKey = HotKey(key: .volumeUp, modifiers: [])
hotKey.keyDownHandler = {
  print("Volume up pressed")
}

the keyDownHandler is not called. In this example, it should print "Volume up pressed" when you press the volume up key.

johnpg commented 1 year ago

I'm seeing the same thing, and this was reported earlier as well (https://github.com/soffes/HotKey/issues/11). I take it no one is looking at this? The earlier thread had a suggested fix. Although I have no idea if that would actually work.

In my case I'm adding modifiers, the idea is to use the volume keys to control the volume on something besides my Mac, but no matter what I try the built in functions take over. Does anyone know if it's possible to make this work?

Thanks!