All of lore.kernel.org
 help / color / mirror / Atom feed
* Laptop Function key (KEY_FN) not recognized by XWindows
@ 2011-02-05  1:05 Rakesh Iyer
  2011-02-07 18:48 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Rakesh Iyer @ 2011-02-05  1:05 UTC (permalink / raw)
  To: 'dmitry.torokhov@gmail.com', linux-input

Hi All.

I am writing a Keyboard driver where the Function key (as seen in Laptop) is used as a modifier.
In my driver I have used "KEY_FN"(from include/linux/input.h) as the keycode for this key.

When I run "xev" the key press events do not get detected.
If I modify the keycode to say KEY_MEDIA, "xev" does show the event properly.

I am wondering how to go about getting this key detected and processed by XWindows.

Thanks and Regards
Rakesh
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

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

* Re: Laptop Function key (KEY_FN) not recognized by XWindows
  2011-02-05  1:05 Laptop Function key (KEY_FN) not recognized by XWindows Rakesh Iyer
@ 2011-02-07 18:48 ` Dmitry Torokhov
  2011-02-07 19:34   ` Rakesh Iyer
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2011-02-07 18:48 UTC (permalink / raw)
  To: Rakesh Iyer; +Cc: linux-input

Hi Rakesh,

On Fri, Feb 04, 2011 at 05:05:50PM -0800, Rakesh Iyer wrote:
> Hi All.
> 
> I am writing a Keyboard driver where the Function key (as seen in Laptop) is used as a modifier.
> In my driver I have used "KEY_FN"(from include/linux/input.h) as the keycode for this key.
> 
> When I run "xev" the key press events do not get detected.
> If I modify the keycode to say KEY_MEDIA, "xev" does show the event properly.
> 
> I am wondering how to go about getting this key detected and processed by XWindows.

Yes, indeed, you are stumbling against limitation of X which does not
allow to pass keycodes above 255 through it.

One option would be assigning KEY_LEFTMETA or KEY_RIGHTMETA to your 'Fn'
key and then adjusting keymaps, but after I looked again at the keys you
have assigned by default to your Fn combinations  can see how one would
want to avoid involving X's keymaps and be able to generate needed
keycodes directly (volume, brightness and other control events) so that
infrastructure need not be hooked into X to be able to react to them.

I think if you implement a hard/soft-fn flag in platform data and, in
case of hard_fn mode would suppress KEY_FN event but rather treat it as
most significant bit in your row data (effectively doubling keymap size)
that would solve your issue.

What do you think?

Thanks.

-- 
Dmitry

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

* RE: Laptop Function key (KEY_FN) not recognized by XWindows
  2011-02-07 18:48 ` Dmitry Torokhov
@ 2011-02-07 19:34   ` Rakesh Iyer
  0 siblings, 0 replies; 3+ messages in thread
From: Rakesh Iyer @ 2011-02-07 19:34 UTC (permalink / raw)
  To: 'Dmitry Torokhov'; +Cc: linux-input

> I think if you implement a hard/soft-fn flag in platform data and, in
> case of hard_fn mode would suppress KEY_FN event but rather treat it as
> most significant bit in your row data (effectively doubling keymap size)
> that would solve your issue.
> 
> What do you think?

That's an excellent suggestion. I think the max row size allows me to do exactly that (and nothing else :)).

Regards
Rakesh

> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Monday, February 07, 2011 10:48 AM
> To: Rakesh Iyer
> Cc: linux-input@vger.kernel.org
> Subject: Re: Laptop Function key (KEY_FN) not recognized by XWindows
> 
> Hi Rakesh,
> 
> On Fri, Feb 04, 2011 at 05:05:50PM -0800, Rakesh Iyer wrote:
> > Hi All.
> >
> > I am writing a Keyboard driver where the Function key (as seen in Laptop) is used as a
> modifier.
> > In my driver I have used "KEY_FN"(from include/linux/input.h) as the keycode for this
> key.
> >
> > When I run "xev" the key press events do not get detected.
> > If I modify the keycode to say KEY_MEDIA, "xev" does show the event properly.
> >
> > I am wondering how to go about getting this key detected and processed by XWindows.
> 
> Yes, indeed, you are stumbling against limitation of X which does not
> allow to pass keycodes above 255 through it.
> 
> One option would be assigning KEY_LEFTMETA or KEY_RIGHTMETA to your 'Fn'
> key and then adjusting keymaps, but after I looked again at the keys you
> have assigned by default to your Fn combinations  can see how one would
> want to avoid involving X's keymaps and be able to generate needed
> keycodes directly (volume, brightness and other control events) so that
> infrastructure need not be hooked into X to be able to react to them.
> 
> I think if you implement a hard/soft-fn flag in platform data and, in
> case of hard_fn mode would suppress KEY_FN event but rather treat it as
> most significant bit in your row data (effectively doubling keymap size)
> that would solve your issue.
> 
> What do you think?
> 
> Thanks.
> 
> --
> Dmitry
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

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

end of thread, other threads:[~2011-02-07 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-05  1:05 Laptop Function key (KEY_FN) not recognized by XWindows Rakesh Iyer
2011-02-07 18:48 ` Dmitry Torokhov
2011-02-07 19:34   ` Rakesh Iyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.