fusion-kbd-controller icon indicating copy to clipboard operation
fusion-kbd-controller copied to clipboard

Is there a way to communicate with keyboard without detaching from kernel ?

Open avilleret opened this issue 5 years ago • 7 comments

Hi,

first of all: thanks a lot for this work, I was looking for such a tool since I bought my Aero 15 more than a year ago.

I'm working on improving le CLI interface and I'm wondering if there is a way to communicate with keyboard without detaching it from kernel ? There is a bottleneck here because claiming interface takes about 200ms. It's fast but not enough for what I'm trying to achieve :-) I want my keyboard color to change when I'm pressing a mod key to show i3wm active shortcut. And I can execute the shortcut in less than 200ms :-)

avilleret avatar Mar 14 '19 08:03 avilleret

There is always the possibility to write a kernel module to control the LEDs, but I have never done this and libUSB was the most convenient solution for me to get results quickly. Maybe one could just write a new backend for the linux kernel RGB api... (http://lkml.iu.edu/hypermail/linux/kernel/1810.2/05683.html)...

martin31821 avatar Mar 14 '19 09:03 martin31821

indeed, thanks I'll look into it

btw, are you open to PR to improve CLI ? my fork is here : https://github.com/avilleret/fusion-kbd-controller (work still in progress)

avilleret avatar Mar 14 '19 09:03 avilleret

sure, any PRs are appreciated. I just dumped the code here in case it's useful for anyone.

martin31821 avatar Mar 14 '19 10:03 martin31821

It is very much useful indeed. (in other words: thanks heaps for this invaluable tool).

I also have a few trivial improvements on the CLI lying around, it seems that I should push them on github to avoid duplicate efforts.

guillaumesalagnac avatar Mar 14 '19 13:03 guillaumesalagnac

yes please @guillaumesalagnac share your work ! I'm working on a kernel module today

avilleret avatar Mar 14 '19 15:03 avilleret

there you go: https://github.com/guillaumesalagnac/fusion-kbd-controller

A kernel module would indeed be awesome !

guillaumesalagnac avatar Mar 14 '19 18:03 guillaumesalagnac

There is no need to unbind, and no need for a kernel module, if you go through hidraw, or, a level higher, through libhidapi-hidraw. As a proof of concept, I threw together a Python module that can also be used as a CLI tool.

yurikhan avatar Jul 10 '22 13:07 yurikhan