Giter Site home page Giter Site logo

kd100's Introduction

Huion KD100 Linux Driver

A simple driver for the Huion KD100 Mini Keydial written in C to give the device some usability while waiting for Huion to fix their Linux drivers. Each button can be configured to either act as a key/multiple keys or to execute a program/command

NOTICE: When updating from v1.31 or below, make sure you updated your config file to follow the new format shown in the default config file

Pre-Installation

Arch Linux/Manjaro:

sudo pacman -S libusb-1.0 xdotool libx11

Ubuntu/Debian/Pop OS:

sudo apt-get install libusb-1.0-0-dev xdotool libx11-dev libwayland-dev

NOTE: Some distros label libusb as "libusb-1.0-0" and others might require the separate "libusb-1.0-dev" package

Installation

You can either download the latest release or run the following:

git clone https://github.com/mckset/KD100.git
cd KD100
make

Running make as root will install the driver as a command and create a folder in ~/.config to store config files

Usage

sudo ./KD100 [options]

-a Assume that the first device that matches the vid and pid is the keydial (skips prompt to select a device)

-c Specify a config file to use after the flag (./default.cfg or ~/.config/KD100/default.cfg is used normally)

-d Enable debug output (can be used twice to output the full packet of data recieved from the device)

-dry Display data sent from the keydial and ignore events

-h Displays a help message

Create .deb package

Creates a Debian Package, that's installs the binary and set udev-Rules for all Users.

make deb

Configuring

Edit or copy default.cfg to add your own keys/commands and use the -c flag to specify the location of the config file. New config files do not need to end in ".cfg". If the config file is not found in the current directory, the driver while look for it in ~/.config/KD100/

Caveats

  • Because the driver relies on xdotool, it only works on X11 desktops but it can be patched for wayland desktops by altering the "handler" function
  • You do not need to run this with sudo if you set a udev rule for the device. Create/edit a .rules (for example 99-huion.rules) file in /etc/udev/rules.d/ and add the following:
SUBSYSTEM=="usb",ATTRS{idVendor}=="256c",ATTRS{idProduct}=="006d",MODE="0666"
SUBSYSTEM=="usb",ATTRS{idVendor}=="256c",ATTRS{idProduct}=="0069",MODE="0666"

Save and then reboot or reload your udev rules with:

sudo udevadm control --reload
sudo udevadm trigger

NOTE: Some systems might require you to run "sudo udevadm trigger" on boot

  • Technically speaking, this can support other devices, especially if they send the same type of byte information, otherwise the code should be easy enough to edit and add support for other usb devices. If you want to see the information sent by different devices, change the vid and pid in the program and run it with the -dry flag

Tested Distros

  • Arch linux
  • Manjaro
  • Ubuntu
  • Pop OS
  • Kali Linux

Known Issues

  • Setting shortcuts like "ctrl+c" will close the driver if it ran from a terminal and it's active
  • The driver cannot trigger keyboard shortcuts from combining multiple buttons on the device

kd100's People

Contributors

mckset avatar zwixx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.