Key mapping question

3 messages, 3 authors, 2012-01-14 · open the first message on its own page

Key mapping question

From: Alan Cox <hidden>
Date: 2012-01-11 22:35:00

I'm currently adding the Fujitsu Q550 to the fujitsu-tablet driver
(http://sourceforge.net/projects/fjbtndrv/files/fjbtndrv/)

The Q550 has 3 buttons - a direction flipping button, a keyboard button
and a ctrl-alt-delete button.

It's labelled as such, it acts as such and I'm tempted to map it as such
including modifiers but that does rather violate the usual behaviour we
expect.

So how should it be mapped ?

I'll send Robert Gerlach a patch once I have a good answer on that one.
It would also be nice to get the kernel bits for this driver upstream.
Barring some trivial printk/pr_debug things it looks to me to be in
perfectly good shape to go upstream, and it's kind of handy when the
buttons work on your tablet !

Alan

Re: Key mapping question

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2012-01-12 18:20:50

Hi Alan,

On Wednesday, January 11, 2012 10:35:50 PM Alan Cox wrote:
I'm currently adding the Fujitsu Q550 to the fujitsu-tablet driver
(http://sourceforge.net/projects/fjbtndrv/files/fjbtndrv/)

The Q550 has 3 buttons - a direction flipping button, a keyboard button
and a ctrl-alt-delete button.

It's labelled as such, it acts as such and I'm tempted to map it as such
including modifiers but that does rather violate the usual behaviour we
expect.
Reading manual it looks like it is a dedicated SAK button. While we do
not currently have a dedicated key code for it we could easily add one.
So how should it be mapped ?

I'll send Robert Gerlach a patch once I have a good answer on that one.
It would also be nice to get the kernel bits for this driver upstream.
Barring some trivial printk/pr_debug things it looks to me to be in
perfectly good shape to go upstream, and it's kind of handy when the
buttons work on your tablet !
Yes, the driver indeed looks nice, changing a few printk and making sure
we do not leak ACPI statuses into the other layers (like what happens in
fujitsu_module_init() - should convert acpi status to linux errno upon
failure - if acpi_bus_register_driver() really returns acpi status) should
make it ready for mainline. I think tt should go to Matthew's
drivers/platform subtree though.

Thanks.

-- 
Dmitry

Re: Key mapping question

From: Robert Gerlach <khnz@gmx.de>
Date: 2012-01-14 18:07:45

Quoting Alan Cox [off-list ref]:
I'm currently adding the Fujitsu Q550 to the fujitsu-tablet driver
(http://sourceforge.net/projects/fjbtndrv/files/fjbtndrv/)

The Q550 has 3 buttons - a direction flipping button, a keyboard button
and a ctrl-alt-delete button.

It's labelled as such, it acts as such and I'm tempted to map it as such
including modifiers but that does rather violate the usual behaviour we
expect.

So how should it be mapped ?
My Lifebook has 5 buttons - scroll up and down, direction flipping, FN  
and ALT.
I prefer to use the ALT button as modifier for the other buttons (like FN), so
ALT + scroll up could start a program. Press and hold ALT for 3 seconds could
report SAK. The modifier buttons must be sticky for one-finger use. I  
think this
needs userspace support to hold the module clean and simple, but I do not know
how to do this right. Currently, I use KEY_LEFTCTRL and KEY_LEFTALT for the FN
and ALT buttons and grab the entire device in userspace (xinput). I'm open to
suggestions and would be happy to implement a real solution.
I'll send Robert Gerlach a patch once I have a good answer on that one.
It would also be nice to get the kernel bits for this driver upstream.
Barring some trivial printk/pr_debug things it looks to me to be in
perfectly good shape to go upstream, and it's kind of handy when the
buttons work on your tablet !
I already improved code cleanness. This version has removed printk's  
and passed
checkpatch. I will send it to platform-driver-x86 list shortly.

   Robert
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help