/hp-primax-macos-keyboard-driver

Experimental HP Pavilion 600 Keyboard (Primax Version) MacOS Driver (ISO Layout)

Primary LanguageCMIT LicenseMIT

HP Primax MacOS Keyboard Driver

HP Pavilion 600 series keyboards and some other keyboards that have been manufactured by Primax are not supported in MacOS. The function keys are working, but others are not. This issue has been asked on the internet a few times (1, 2, 3).

According to a customer review on November 22, 2019 from Amazon, with a name Lirio, this issue only happens in the HP Pavilion 600 keyboards that have a usb dongle with version 1.05. I think Primax fixed the issue later and updated the USB dongle to version 1.07.

What is the issue?

These keyboards manufactured by Primax send one extra byte with every keystroke. After my research, I realized that the implementation is not wrong according to HID (Human Interface Device) specification, but not a common one. Windows supports parsing the HID data with the external byte; however MacOS does not. Further information can be found here.

Support for the extra byte has been implemented to Linux in February 2019 and published with the Linux Kernel 5.2 in April 2019. Further information can be found here and here.

HP Pavilion 600 keyboard is not the only keyboard with this issue; some from Lenovo and Asus have that issue as well.

Before the Linux patch, a Linux driver has been written for Lenovo Ultraslim keyboard, and a fork exists for HP Pavilion 600. However these drivers are Linux only.

The Project

This is an experimental HP Pavilion 600 driver for MacOS. It basically reads the input using hidapi, and interprets the input. It uses CGEvent API from Apple to simulate key inputs.

In addition to basic keystrokes, it supports key combinations (at some level), and basic press & hold key repeat. However, this driver is still an experiment.

How to run?

First, install hidapi using brew.

brew install hidapi

Some build tools and libraries are also required. It is advised to install Xcode. Edit the Makefile using your hidapi library path (brew prints it after the installation).

Then run make. This will create a executable called driver. Run driver with sudo.

For an unknown reason, sometimes the library cannot open the keyboard device. Try rerunning the command a few times.

Contribution

Please feel free to contribute.

Authors

License

See LICENSE.md.