* [PATCH] thinkpad_acpi: Always report scancodes for hotkeys
@ 2011-01-14 21:54 Seth Forshee
2011-01-14 22:25 ` Henrique de Moraes Holschuh
2011-02-21 20:46 ` Matthew Garrett
0 siblings, 2 replies; 5+ messages in thread
From: Seth Forshee @ 2011-01-14 21:54 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86
Some thinkpad hotkeys report key codes like KEY_FN_F8 when something
like KEY_VOLUMEDOWN is desired. Always provide the scan codes in
addition to the key codes to assist with debugging these issues. Also
send the scan code before the key code to match what other drivers do,
as some userspace utilities expect this ordering.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
drivers/platform/x86/thinkpad_acpi.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index dd59958..eb99223 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2275,16 +2275,12 @@ static void tpacpi_input_send_key(const unsigned int scancode)
if (keycode != KEY_RESERVED) {
mutex_lock(&tpacpi_inputdev_send_mutex);
+ input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode);
input_report_key(tpacpi_inputdev, keycode, 1);
- if (keycode == KEY_UNKNOWN)
- input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN,
- scancode);
input_sync(tpacpi_inputdev);
+ input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode);
input_report_key(tpacpi_inputdev, keycode, 0);
- if (keycode == KEY_UNKNOWN)
- input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN,
- scancode);
input_sync(tpacpi_inputdev);
mutex_unlock(&tpacpi_inputdev_send_mutex);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] thinkpad_acpi: Always report scancodes for hotkeys
2011-01-14 21:54 [PATCH] thinkpad_acpi: Always report scancodes for hotkeys Seth Forshee
@ 2011-01-14 22:25 ` Henrique de Moraes Holschuh
2011-01-14 22:56 ` Seth Forshee
2011-02-21 20:46 ` Matthew Garrett
1 sibling, 1 reply; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2011-01-14 22:25 UTC (permalink / raw)
To: Seth Forshee; +Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86
On Fri, 14 Jan 2011, Seth Forshee wrote:
> Some thinkpad hotkeys report key codes like KEY_FN_F8 when something
> like KEY_VOLUMEDOWN is desired. Always provide the scan codes in
> addition to the key codes to assist with debugging these issues. Also
> send the scan code before the key code to match what other drivers do,
> as some userspace utilities expect this ordering.
Do I have your word of honour that canonical is not going to start using
scancodes instead of keycodes in Ubuntu to trigger actions?
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] thinkpad_acpi: Always report scancodes for hotkeys
2011-01-14 22:25 ` Henrique de Moraes Holschuh
@ 2011-01-14 22:56 ` Seth Forshee
2011-01-15 2:13 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 5+ messages in thread
From: Seth Forshee @ 2011-01-14 22:56 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86
On Fri, Jan 14, 2011 at 08:25:17PM -0200, Henrique de Moraes Holschuh wrote:
> On Fri, 14 Jan 2011, Seth Forshee wrote:
> > Some thinkpad hotkeys report key codes like KEY_FN_F8 when something
> > like KEY_VOLUMEDOWN is desired. Always provide the scan codes in
> > addition to the key codes to assist with debugging these issues. Also
> > send the scan code before the key code to match what other drivers do,
> > as some userspace utilities expect this ordering.
>
> Do I have your word of honour that canonical is not going to start using
> scancodes instead of keycodes in Ubuntu to trigger actions?
That would be silly. The reason for this change is to aid in collecting
the data to update udev's keymaps for non-standard keys (see [1]). udev
uses the EVIOCSKEYCODE ioctl to associate the correct key code with the
scan codes. We don't intend to use scan codes instead of key codes.
[1] http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=extras/keymap/README.keymap.txt;hb=HEAD
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] thinkpad_acpi: Always report scancodes for hotkeys
2011-01-14 22:56 ` Seth Forshee
@ 2011-01-15 2:13 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2011-01-15 2:13 UTC (permalink / raw)
To: Seth Forshee; +Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86
On Fri, 14 Jan 2011, Seth Forshee wrote:
> > Do I have your word of honour that canonical is not going to start using
> > scancodes instead of keycodes in Ubuntu to trigger actions?
>
> That would be silly. The reason for this change is to aid in collecting
...
> the data to update udev's keymaps for non-standard keys (see [1]). udev
> uses the EVIOCSKEYCODE ioctl to associate the correct key code with the
> scan codes. We don't intend to use scan codes instead of key codes.
Very well. I *will* hold you to that. I do not want a repeat of the
KEY_VOLUMEUP/DOWN "active notification" fiasco.
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] thinkpad_acpi: Always report scancodes for hotkeys
2011-01-14 21:54 [PATCH] thinkpad_acpi: Always report scancodes for hotkeys Seth Forshee
2011-01-14 22:25 ` Henrique de Moraes Holschuh
@ 2011-02-21 20:46 ` Matthew Garrett
1 sibling, 0 replies; 5+ messages in thread
From: Matthew Garrett @ 2011-02-21 20:46 UTC (permalink / raw)
To: Seth Forshee
Cc: Henrique de Moraes Holschuh, ibm-acpi-devel, platform-driver-x86
Applied, thanks.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-21 20:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 21:54 [PATCH] thinkpad_acpi: Always report scancodes for hotkeys Seth Forshee
2011-01-14 22:25 ` Henrique de Moraes Holschuh
2011-01-14 22:56 ` Seth Forshee
2011-01-15 2:13 ` Henrique de Moraes Holschuh
2011-02-21 20:46 ` Matthew Garrett
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.