Re: input devices handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitry Torokhov wrote:
[power/sleep buttons]
>> Before, there was /proc/acpi/event and /etc/acpid/* stuff,
>> and it was easy (but somewhat clumsy) to act to system power
>> down button.  But the "proper way" now is to handle
>> /dev/input/event* interface, because such "Power" button can
>> be on a keyboard, on a remote control, and so on.  I understand
>> the idea, and I like it.
>>
>> But now the question.  How one supposed to find all the devices
>> which generate such events?  I mean not about scanning the /dev
>> directory, which can be done once at startup, but about REscanning
>> it to find which NEW keyboards and the like appeared since last
>> (re)scan and which were removed.
> 
> You can either listen to hotplug events or poll (select)
> /proc/bus/input/devices - waiters are woken up every time we
> add or remove a new input device or a new input handler.

Hmm.  Seems to be too much for a simple "power down when i press
`power' button' stuff.  Where the only thing needed is to run a
script when this button is pressed, but the code to watch for the
input device changes becomes larger and more complex than the
actual thing it should do.  (Maybe I stop somewhere at the middle:
scan all devices at startup and rescan when receiving a HUP signal,
or require a restart.  But the whole select-loop looks ugly too,
for such a simple task ;)

So this basically turns into another question being discussed in a
parallel thread: /dev/input/mice, /dev/input/keyboard, and maybe
/dev/input/event meta-devices...

Thanks!

/mjt
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux