linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: Add keycodes for touchpad on/off keys
@ 2010-11-08 12:42 Bastien Nocera
  2010-11-09  7:39 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien Nocera @ 2010-11-08 12:42 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov

Some laptops will have a "touchpad toggle" soft button, which
expects user-space to turn off the touchpad themselves, some
other devices will do this in hardware, but send key events telling
us that the touchpad has been turned off/on.

KEY_TOUCHPAD_ON/KEY_TOUCHPAD_OFF will be used by user-space to
show a popup with the status of the touchpad.

Signed-Off-By: Bastien Nocera <hadess@hadess.net>
---
 include/linux/input.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/input.h b/include/linux/input.h
index 896a922..46dca75 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -545,6 +545,10 @@ struct input_absinfo {
 #define KEY_CONTEXT_MENU	0x1b6	/* GenDesc - system context menu */
 #define KEY_MEDIA_REPEAT	0x1b7	/* Consumer - transport control */
 
+#define KEY_TOUCHPAD_TOGGLE	0x1b8	/* Ask user-space to switch the touchpad off */
+#define KEY_TOUCHPAD_ON		0x1b9	/* Tell user-space touchpad is now on */
+#define KEY_TOUCHPAD_OFF	0x1ba	/* As above but off */
+
 #define KEY_DEL_EOL		0x1c0
 #define KEY_DEL_EOS		0x1c1
 #define KEY_INS_LINE		0x1c2
-- 
1.7.3.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: Add keycodes for touchpad on/off keys
  2010-11-08 12:42 [PATCH] Input: Add keycodes for touchpad on/off keys Bastien Nocera
@ 2010-11-09  7:39 ` Dmitry Torokhov
  2010-11-09 11:13   ` Bastien Nocera
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2010-11-09  7:39 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-input

On Mon, Nov 08, 2010 at 12:42:10PM +0000, Bastien Nocera wrote:
> Some laptops will have a "touchpad toggle" soft button, which
> expects user-space to turn off the touchpad themselves, some
> other devices will do this in hardware, but send key events telling
> us that the touchpad has been turned off/on.
> 
> KEY_TOUCHPAD_ON/KEY_TOUCHPAD_OFF will be used by user-space to
> show a popup with the status of the touchpad.
> 
> Signed-Off-By: Bastien Nocera <hadess@hadess.net>
> ---
>  include/linux/input.h |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/input.h b/include/linux/input.h
> index 896a922..46dca75 100644
> --- a/include/linux/input.h
> +++ b/include/linux/input.h
> @@ -545,6 +545,10 @@ struct input_absinfo {
>  #define KEY_CONTEXT_MENU	0x1b6	/* GenDesc - system context menu */
>  #define KEY_MEDIA_REPEAT	0x1b7	/* Consumer - transport control */
>  
> +#define KEY_TOUCHPAD_TOGGLE	0x1b8	/* Ask user-space to switch the touchpad off */

Just off or is it true toggle?

> +#define KEY_TOUCHPAD_ON		0x1b9	/* Tell user-space touchpad is now on */
> +#define KEY_TOUCHPAD_OFF	0x1ba	/* As above but off */

I do not like the idea that keycodes are limited to signalling the
state. Either they can also request the transition to given state or we
need to find some other way to communicate the state.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: Add keycodes for touchpad on/off keys
  2010-11-09  7:39 ` Dmitry Torokhov
@ 2010-11-09 11:13   ` Bastien Nocera
  0 siblings, 0 replies; 3+ messages in thread
From: Bastien Nocera @ 2010-11-09 11:13 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

On Mon, 2010-11-08 at 23:39 -0800, Dmitry Torokhov wrote:
> On Mon, Nov 08, 2010 at 12:42:10PM +0000, Bastien Nocera wrote:
> > Some laptops will have a "touchpad toggle" soft button, which
> > expects user-space to turn off the touchpad themselves, some
> > other devices will do this in hardware, but send key events telling
> > us that the touchpad has been turned off/on.
> > 
> > KEY_TOUCHPAD_ON/KEY_TOUCHPAD_OFF will be used by user-space to
> > show a popup with the status of the touchpad.
> > 
> > Signed-Off-By: Bastien Nocera <hadess@hadess.net>
> > ---
> >  include/linux/input.h |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> > 
> > diff --git a/include/linux/input.h b/include/linux/input.h
> > index 896a922..46dca75 100644
> > --- a/include/linux/input.h
> > +++ b/include/linux/input.h
> > @@ -545,6 +545,10 @@ struct input_absinfo {
> >  #define KEY_CONTEXT_MENU	0x1b6	/* GenDesc - system context menu */
> >  #define KEY_MEDIA_REPEAT	0x1b7	/* Consumer - transport control */
> >  
> > +#define KEY_TOUCHPAD_TOGGLE	0x1b8	/* Ask user-space to switch the touchpad off */
> 
> Just off or is it true toggle?

It's a toggle.

> > +#define KEY_TOUCHPAD_ON		0x1b9	/* Tell user-space touchpad is now on */
> > +#define KEY_TOUCHPAD_OFF	0x1ba	/* As above but off */
> 
> I do not like the idea that keycodes are limited to signalling the
> state. Either they can also request the transition to given state or we
> need to find some other way to communicate the state.

The transition is done completely in hardware, so there's no state
whatsoever on the software side, just notifications that something
happened.

This is similar to what some hardware does with mixer settings, still
sending events about the hardware being muted, or the volume having
changed when they handle the mixer events in hardware (at least some
Thinkpads and HP laptops do that).

I don't see how we can export this information in any other way...

Cheers


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-09 11:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08 12:42 [PATCH] Input: Add keycodes for touchpad on/off keys Bastien Nocera
2010-11-09  7:39 ` Dmitry Torokhov
2010-11-09 11:13   ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).