Open pedrorrivero opened 4 years ago
I got around this by using hs.eventtap.event.newSystemKeyEvent()
instead for volume/brightness up/down.
Thank you @latenitefilms! Does it work for every keyboard layout though? Also, Volume seems to work just fine with the regular API call.
Yes, I believe so. It definitely works on my MacBook Pro (15-inch, 2017), which doesn't have a dedicated volume/brightness button, and also still works if I connect an external keyboard.
Possibly related: one thing I ran into setting screen saver options and having them reflected in the Preferences panel was the need to killall cfprefsd
per https://superuser.com/a/914884
Some actions performed through the API do take effect but never get reflected on either System Preferences, or the scroll bar on a MacBook with touchbar. I have found these ones so far:
hs.brightness.set()
hs.audiodevice:setMuted()
Furthermore, some states such as the input muted state get overwritten when an app is launched (e.g. Facetime).