From: clement.vuchener@gmail.com (Clément Vuchener)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Writing a driver for the Corsair K90 keyboard
Date: Sun, 2 Aug 2015 10:35:44 +0200 [thread overview]
Message-ID: <55BDD660.8040304@gmail.com> (raw)
Hello.
I first sent this email to kernel-mentors, but I got no response. So I
am sending it again here.
I wrote a driver for the Corsair K90 keyboard, it is my first kernel
development and I have a few questions about how to properly do a few
things (mainly interactions with the user space).
The Corsair Vengeance K90 is a mechanical keyboard with a backlight,
macro keys (G1 to G18) and some other special keys (macro recording,
profile switching, changing the light level or disabling the "windows
logo" keys). The macro playback can be switched between hardware or
software (from the driver not a key). Using the generic HID driver, the
macro keys and special keys send wrong key code or no key code at all
(because of the HID usage code used by the keyboard).
The source for my driver can be found at this address:
https://github.com/cvuchener/k90-linux-driver . It solves the problem of
the generic driver and add some handling of the other features (see the
README for more details).
So, my questions are about:
- Macro keys
For handling the macro keys from a software, they need to send some
keycodes but I have no idea what to use. Currently I use F keys above 12
and some MISC buttons and a parameter for changing that (at load time).
Are there 18 keycodes reserved for custom uses? It would also be
possible to send no keycode at all and use a specific software listening
to the hidraw or hiddev devices, but I think it would be better to be
able to use a generic software.
- Backlight
I chose to use a led class device to manage the backlight. It seems to
work fine but when unregistering the driver, the light is set to 0. The
keyboard remembers the previous light level and so nothing should be
done when registering or unregistering the driver. Is the led class the
right class for that? or am I using it wrong?
- Sending the macro profiles to the keyboard
I created a "profile" branch on my git repo for adding binary attributes
used for sending macro data to the keyboard. But I am not sure it is a
good idea, it may be better to leave that to the user space.
Any other comment is welcome.
Thanks,
Cl?ment
next reply other threads:[~2015-08-02 8:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-02 8:35 Clément Vuchener [this message]
2015-08-10 9:00 ` Writing a driver for the Corsair K90 keyboard Clément Vuchener
2015-08-10 9:14 ` Ricardo Ribalda Delgado
2015-08-10 10:15 ` Clément Vuchener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55BDD660.8040304@gmail.com \
--to=clement.vuchener@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).