All work

x85ctl

An unofficial macOS app for the ATTACK SHARK X85 keyboard, built on a protocol I reverse-engineered because the official driver only runs on Windows.

x85ctl home screen showing a photo of the X85 keyboard with the colours read back from it.

I have an ATTACK SHARK X85 keyboard with per-key RGB lighting, remappable keys and macros. All of it is configured through the maker's software, which only exists for Windows. On a Mac the keyboard works as a plain keyboard and nothing else.

So I wrote my own driver. I reverse-engineered the protocol the keyboard speaks from the vendor's own software, then built a native macOS app on top of it that does what the official one does.

Reverse-engineered, never run

The protocol was read out of the vendor's software by static analysis only: nothing was executed. Packet layouts, commands and timing are written up in a protocol document, and every claim is tagged as observed on hardware, read from the vendor code, or inferred.

Safe by design

Writes to the keyboard are off until you switch them on. Every packet comes from one builder that follows layouts taken from the vendor code, and there is no code path that touches the bootloader or the firmware. Commands that are only partly understood are disabled in the interface instead of guessed.

Tested without hardware

Unit tests compare every transaction byte by byte with what the vendor code produces, and the transport is mocked, so the pacing, retries and read-back are checked without a keyboard plugged in.

Only what the keyboard lets you read

The keyboard can't report its effect, keymap or settings back, only its per-key colours. So profiles live on disk as JSON, with autosave, import and export, and one click sends a profile to the keyboard.

A native Mac app

It talks to the keyboard through HIDAPI with no kernel driver, no background daemon and no Input Monitoring permission, and it leaves the standard keyboard to macOS. It lives in the menu bar when the window is closed.

Macros recorded from the real keyboard

Macros are built on a timeline or recorded by pressing keys, with the real delays between them. Keys are captured by position, so layouts and the macOS command and control swap don't matter.

Snake on the keys

As a test of live updates, the keys' LEDs are the game board. The arrow keys steer, and one upload takes about half a second, which sets the speed of any live effect on this keyboard.

Paint the keys

A demo of the per-key lighting. Pick a colour and click or drag across the keys. It only draws here and sends nothing to a real keyboard.

The ATTACK SHARK X85 keyboard seen from above.
Next projectSonest