<div dir="ltr"><div>hello,</div><div>just to speak clearly and explain that I agree with you</div><div><br></div><div>                          compatible = "gpio-keys";<br>                           label = "mediakey";<br>                         nextkey: gpiokey,next {<br>                                       label = "next";<br>                                     gpios = <&gpio 22 1>;<br>                                       linux,code = <163>; /* 163 KEY_NEXTSONG */<br>                                      status = "disabled";<br>                                };</div><div>for me this is a keyboard definition with one key.</div><div>I think that we spoke about exactly the same thing.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 20 juin 2020 à 14:33, Alexander Dahl <<a href="mailto:post@lespocky.de">post@lespocky.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hei hei,<br>
<br>
On Fri, Jun 19, 2020 at 10:25:52PM +0200, Marc Chalain wrote:<br>
> Le ven. 19 juin 2020 à 21:39, Alexander Dahl <<a href="mailto:post@lespocky.de" target="_blank">post@lespocky.de</a>> a écrit :<br>
> > However, I defined my button in dts as key, not just as gpio, because<br>
> > it is actually a key and linux has infrastructure for that.<br>
> > Furthermore there are reliable userspace libraries to not reinvent the<br>
> > wheel. I was able to build something around libevdev in two days.<br>
> ><br>
> This solution may be complicated when you use some buttons for an<br>
> application,<br>
> and just another button for a system feature. You have to manage several<br>
> keyboards,<br>
>  to name each one by udev (or mdev) to use the good one with each<br>
> application.<br>
<br>
No and no.<br>
<br>
There's no keyboard involved, the keycode I used is not even assigned<br>
to a key usually found on keyboards. The system has neither udev nor<br>
mdev, the key is ready by just defining it in dts.<br>
<br>
> A daemon on GPIO will never replace a keyboard. When you need several<br>
> events<br>
> key and a short time response, a keyboard is more powerful.<br>
> The Daemon is useful for few events in the life of the system, and you<br>
> don't want<br>
> modify an application.<br>
<br>
This is exactly my usecase, a tiny daemon doing basically nothing but<br>
waiting for a button press once a year or so.<br>
<br>
> > Besides: your gpiod uses the well known libgpiod, but is not part of<br>
> > that project, right? That is a little puzzling, people will mix that<br>
> > up.<br>
> ><br>
> Yes I'm sorry for the name. I wanted to use direct access to the<br>
> /dev/gpiochip,<br>
> and after I saw that libgpiod was a <a href="http://kernel.org" rel="noreferrer" target="_blank">kernel.org</a> project. I should change the<br>
> name<br>
> but it's the right name for its usage, and it uses libgpiod, then the<br>
> daemon promotes<br>
> the library. Another name would have been stupid.<br>
> I will propose the daemon to the libgpiod developer, when I will be ready.<br>
<br>
Looking forward to that. :-)<br>
<br>
Greets<br>
Alex<br>
<br>
-- <br>
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first<br>
\ / CAMPAIGN     | speech censured, the first thought forbidden, the<br>
 X  AGAINST      | first freedom denied, chains us all irrevocably.«<br>
/ \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)<br>
</blockquote></div>