2014-11-29 17:24:09

by Pali Rohár

[permalink] [raw]
Subject: Disable input device

Hello,

there is request to introduce some option (via sysfs) to disable
one input device. Originally it was for tsc2005 touchscreen found
on Nokia N900 cellphone. Use case is to completely disable
touchscreen when phone is in pocket or when screen is locked via
slide switch (to prevent random clicks).

But it would be better to have disable option for all input
devices. Sometimes input device is not use and only consume
power. Another case is when input device (e.g. keyboard or
touchpad) is integrated into machine (e.g. on laptops) and user
does not want to use it (so make sure that kernel does not send
events to userspace).

I would like to ask, how to solve it?

What do you think about adding new sysfs file "disable" (accept
values 1 or 0) for every input device? With "1" it cause that
kernel will drop all events from specific input device and if
driver provide some function is can be called (e.g. for power
management or disabling device at hardware level).

Or do you prefer something other?

--
Pali Rohár
[email protected]


Attachments:
signature.asc (198.00 B)
This is a digitally signed message part.

2014-12-06 12:47:13

by Pavel Machek

[permalink] [raw]
Subject: Re: Disable input device

On Sat 2014-11-29 18:24:03, Pali Roh?r wrote:
> Hello,
>
> there is request to introduce some option (via sysfs) to disable
> one input device. Originally it was for tsc2005 touchscreen found
> on Nokia N900 cellphone. Use case is to completely disable
> touchscreen when phone is in pocket or when screen is locked via
> slide switch (to prevent random clicks).
>
> But it would be better to have disable option for all input
> devices. Sometimes input device is not use and only consume
> power. Another case is when input device (e.g. keyboard or
> touchpad) is integrated into machine (e.g. on laptops) and user
> does not want to use it (so make sure that kernel does not send
> events to userspace).
>
> I would like to ask, how to solve it?
>
> What do you think about adding new sysfs file "disable" (accept
> values 1 or 0) for every input device? With "1" it cause that
> kernel will drop all events from specific input device and if
> driver provide some function is can be called (e.g. for power
> management or disabling device at hardware level).

That makes sense to me. Dmitry, would such interface be acceptable?

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2014-12-06 15:29:04

by Chuck Ebbert

[permalink] [raw]
Subject: Re: Disable input device

On Sat, 29 Nov 2014 18:24:03 +0100
Pali Rohár <[email protected]> wrote:

> What do you think about adding new sysfs file "disable" (accept
> values 1 or 0) for every input device? With "1" it cause that
> kernel will drop all events from specific input device and if
> driver provide some function is can be called (e.g. for power
> management or disabling device at hardware level).
>

Yeah, I'd like to see this too. I am using xinput to disable the
notebook keyboard so the cats walking across it don't cause any
problems. It would be nice to have a better solution.