View Full Version : Making a Linux driver

01-19-2018, 12:56 PM
Yesterday I just purchased my ROG Pugio mouse.
I was thought that I boot into Windows, setup the mouse, bind the keys and then I can boot back into Linux. But it was not that easy. Pugio, just like any other smart programmable mouses, is a composite device. It means that device consists of at least 2 virtual input devices: mouse and keyboard (for keyboard button events). The mouse part is working fine, but the keyboard was not. Looks like the keyboard device is not just a regular keyboard device. The events from it are ignored. At least it uses a HID protocol.

So I started with protocol reverse-engineering and starting writing a userspace driver: https://github.com/kyokenn/rogdrv
I has made a virtual uinput device driver, which reads events from mouse and generates regular uinput events.

Then I figured out that Pugio actually consists of 3 HID devices: mouse, keyboard, and some custom HID device. I was curious about the 3rd device and found out that it's a control device for changing a mouse settings. I reverse-engineered it a little and implemented some features like: button binding, changing LED colors, setting a DPI. So this turned really good.

The Armoury software was so buggy. When you bind a button it can randomly unbind another button. If you disable a button and try to bind another button, it crashes. And it keep crashing until you enable all buttons back or reset all settings to defaults. So I'm happy that I have my own little tool for configuring a mouse.

It will be good it I had an access to protocol documentation. But I think it will never happen.
I also interested how does this keyboard device works in Windows. Does it uses some custom HID device driver? Will it work on vanilla Windows installation without internet access? Maybe Windows treats it as some USB HID remote control?

08-27-2019, 02:40 PM
I have updated my driver. More features have been added. More mices are supported now, thanks to the people who are helping with testing.