'New keyboard and KeyRemap4MacBook key bindings'

9 years ago

Bought a new keyboard, the DAS Keyboard Professional S. Maybe now i'll finally learn how to code properly :)

Also, took some time to create key bindings for media and brightness controls (for [KeyRemap4MacBook](https://pqrs.org/macosx/keyremap4macbook/)) for it. Feel free to use my private.xml file and modify as you see fit. The script will only modify keys when the external keyboard is connected. Also, you might need to use the app's EventViewer to change the Vendor and Device ID values :)

I tried to get the sleep key to lock my mac, but i think i'll need to tinker with AppleScript to accomplish that one. Just haven't had the time yet.

Here's the script:

DAS 0x24f0

DAS_KEYBOARD 0x0137

KeyCode::VK_OPEN_URL_APP_Lock file:///Applications/QuickLock.app

DAS Media Volume Mute private.das_vol_mute DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F1, KeyCode::VK_CONSUMERKEY_VOLUME_MUTE

DAS Media Volume Down private.das_vol_down DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F2, KeyCode::VK_CONSUMERKEY_VOLUME_DOWN

DAS Media Volume Up private.das_vol_up DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F3, KeyCode::VK_CONSUMERKEY_VOLUME_UP

DAS Media Play/Pause private.das_play_pause DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F5, KeyCode::VK_CONSUMERKEY_MUSIC_PLAY

DAS Media Prev private.das_prev DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F7, KeyCode::VK_CONSUMERKEY_MUSIC_PREV

DAS Media Next private.das_next DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F8, KeyCode::VK_CONSUMERKEY_MUSIC_NEXT

DAS Brightness Down private.das_brightness_down DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F9, KeyCode::VK_CONSUMERKEY_BRIGHTNESS_DOWN

DAS Brightness Up private.das_brightness_up DeviceVendor::DAS, DeviceProduct::DAS_KEYBOARD __KeyToKey__ KeyCode::F10, KeyCode::VK_CONSUMERKEY_BRIGHTNESS_UP

Lock private.das_lock __KeyToKey__ KeyCode::F12, KeyCode::VK_OPEN_URL_APP_Lock