Media keys along with some other keys are not handled through the standard apple keyboard event subsystem. They are treated differently, and therefore emulating them from software requires special code (EventTap won't work!). Here's a function that does this: void HIDPostAuxKey(uint32_t key, bool down) { @autoreleasepool { NSEvent* ev = [NSEvent otherEventWithType …
An excellent piece of code to do the above is here: //clang++ -std=c++11 -stdlib=libc++ -framework Foundation nsarray.mm -o nsarray /* Note: * - libstdc++ has been frozen by Apple at a pre-C++11 version, so you must opt for the newer, BSD-licensed libc++ * - Apple clang 4.0 …
How to get/set master volume in OS X. Many sample codes online use the deprecated API. This uses the currently 'legal' API. #include #include #include #include #include static AudioDeviceID getDefaultOutputDeviceID() { AudioDeviceID outputDeviceID = kAudioObjectUnknown; // get …
Here are the steps to prepare an OS X system for debugging kernel modules such as drivers. The instructions are deliberately brief to save the reader from tons of text. If you search the web, you will come across may resources that point to using GDB to debug the kernel …
How to view kernel logs is OS X You can use the command line tool log for this. This command accepts a predicate argument that can be used to , well build predicates, that when evaluates to true, the log message will be printed. It takes a command argument that decides …