CammillaDSP - Controlling from shell script

Typically all these devices send multimedia key events (Volume up, volume down, emulated USB/BT keyboard). It's up to you to configure your system to pass these events as needed. No idea in OSX, but in linux you simply disable the default shortcuts in your desktop environment (so that they are not consumed) and configure a custom handler in that shortcut configurator. For headless setups you can configure an udev rule , e.g. https://askubuntu.com/questions/239560/problem-binding-a-shortcut-to-a-function-multimedia-key . Or lirc can handle keyboard keys too.

In linux for more complicated setups you can exclude a specific USB device from the desktop environment, and then have one USB controller for controlling the default system volume (e.g. the media keys on your keyboard) and another USB controller handled by the custom setup (e.g. the USB/BT rotary encoder).