[PATCH evtest 2/2] Add one-shot query functionality

Daniel Drake dsd at laptop.org
Fri Jul 15 05:12:06 PDT 2011


On 15 July 2011 07:15, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> On Thu, Jul 14, 2011 at 05:53:17PM +0100, Daniel Drake wrote:
>> Add functionality to query evdev state of a specific key, switch, button,
>> LED or sound event. This is useful in programs such as powerd
>> (http://wiki.laptop.org/go/Powerd) which need to query things like the
>> state of the laptop lid switch from shell code.
>>
>> Original monitor-mode functionality is left unchanged and is still
>> activated by default. New usage modes are explained in the man page.
>>
>> Signed-off-by: Daniel Drake <dsd at laptop.org>
>
> Merged patch 1/2, thanks.
>
> For this one, a few comments:

Thanks for the extensive review. All your comments make sense, I'll
make the changes today. A couple of questions:

For the default mode, MODE_GRAB is indeed a bad name. what do you
think about MODE_CAPTURE? Alternatively, MODE_DISPLAY? MODE_MONITOR?

As for the argument format, I will change it so that --query is an
optional argument with no parameters, but when passed, 3 positional
parameters are required: device, event type, key

i.e. evtest --query /dev/input/event3 sw SW_DOCK

Does that look OK?

Thanks,
Daniel


More information about the xorg-devel mailing list