I'm trying to post volume button events using Core Graphics. Other types of events are working fine but the volume buttons aren't. I'm creating the event using CGEventCreateKeyboardEvent
and passing in kVK_VolumeUp
(0x48
) but it doesn't seem to be working. Other key codes are working (like kVK_RightArrow
and kVK_ANSI_Semicolon
), but the volume buttons aren't.
I'm hoping that I'm missing a step here. I tried posting kVK_F12
but of course, that's F12 and not volume-up. I also tried posting fn+F12 but that didn't work either. Perhaps I need to call CGEventSetIntegerValueField
?
Am I going to have to drop down a level and use I/O Kit instead of Core Graphics?