Today I decided to buy a mechanical keyboard. I was looking for a minimalist TKL and the one I picked was an Ozone Strike Battle with brown cherry mx switches. What I wasn’t counting on is the crappy support provided by a vendor that could render useless a simple device just like a keyboard.
The first time I plugged the keyboard in my macbook, the keys were completely messed up. And I’m not talking about the symbols or special keys. Several keys were bound to the same value and some others didn’t even have a valued assigned. After spending a few minutes googling, I found a thread that gave me the first hint about what was happening. Unfortunately this didn’t work for me and it took me some time to understand why. It seems that newer keyboards have different ids which are not configured. The solution was to clone the repository found in the previous link, use their tool to detect the bcdDevice, add it to the config and compile the kernel extension.
I’m not an expert and it took me a couple of hours to do so because I couldn’t find the right sources for one of the dependencies that are required – IOKit – but once I did it, everything worked as expected and right now I’m writing this post using my new mechanical keyboard 🙂
Step by Step: How to make it work for you?
- Navigate to the link mentioned above and download the kernel extension mentioned there ( or use this direct link )
- Try to installed it. If you’re using El Capitan, you’ll have to disable System Integrity protection to load the kernel extension. Try the following:
- Reboot your computer and press cmd + R during boot to enter recovery mode.
- Open a console and type csrutil disable; reboot. This will allow you to use kernel extensions that were not signed by Apple.
- If you are running a previous version of OSX, then you can just do sudo nvram boot-args=kext-dev-mode=1
- Load the extension: kextutil -v /System/Library/Extensions/IOUSBHIDDriverDescriptorOverride.kext
- Plug in the keyboard. If your keyboard is now responding correctly then everything is OK. If not, you might have one of the new versions that have a different bcdDevice. You can download this custom version of the kernel extension that I compiled and see if it works for you: http://davidgouveia.net/goodies/IOUSBHIDDriverDescriptorOverride.kext.tar.gz
If you want to compile it by yourself, make sure you have xcode installed and ruby 2.2.0.
- Clone the code from this repository: https://github.com/thefloweringash/iousbhiddriver-descriptor-override
- Identify your keyboard using the following commands ( if you don’t have brew you need to install it first ):
brew install libusb bundle install --without "" rake scan
- Check the idVendor, idProduct, and bcdDevice. Open the Info.plist file, locate the blocks of code related to the strike battle keyboard ( just search for “strike” ). Change those blocks of code to match the idVendor, idProduct, and bcdDevice values that you found using the previous command.
- Compile the code using the instructions that you can find on the repository’s README.md:
# dependencies gem install bundler bundle install --without scan # build xcodebuild sudo cp -r build/Release/IOUSBHIDDriverDescriptorOverride.kext \ /System/Library/Extensions sudo kextutil \ /System/Library/Extensions/IOUSBHIDDriverDescriptorOverride.kext
This is it, you should now have a working kernel extension that suits your needs. Enjoy your new keyboard 🙂