Filtered by: tags=osx

How to programmatically emulate Appple special keys such as media navigation & power keys

June 28, 2019 |  osx  keyboard  keys  Objective-C  HID 
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 th

Converting a std

June 26, 2019 |  Objective-C  osx  memory  array  vector  string 
An excellent piece of code to do the above is [here](https://gist.github.com/jeremy-w/3777700): Again, thanks to this [gist](https://gist.github.com/jeremy-w).

Set/get volume in OS X

June 25, 2019 |  audio  osx  C  volume 
How to get/set master volume in OS X. Many sample codes online use the deprecated API. This uses the currently 'legal' API. Adapted from this SO post.

Setting up OS X for kernel debugging

Jan. 26, 2019 |  driver  debug  osx  kext  gdb  kernel  lldb  mac 
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 de

How to view kernel logs in OS X

Jan. 19, 2019 |  log  driver  osx  iokit  mac 
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 argume