* Fn keys on Dell Latitude E6440 @ 2014-04-14 14:51 Pali Rohár 2014-05-04 8:25 ` Pali Rohár 2014-05-17 14:39 ` Pali Rohár 0 siblings, 2 replies; 9+ messages in thread From: Pali Rohár @ 2014-04-14 14:51 UTC (permalink / raw) To: linux-hotplug [-- Attachment #1: Type: Text/Plain, Size: 1520 bytes --] Hello, on my notebook dell-wmi kernel driver generates some scan codes when I press some of Fn key combinations. Now all these scan codes are mapped to key "prog3". I would like to add some actions for these Fn key combinations, so what do you think? Which key codes should be assigned for these scan codes? Note that these combinations are not special (and labeled) as other (like Fn+F11 = play/pause) and seems like windows does not recognize them. Matthew, you are author of dell-wmi driver, do you know if there are some other secrets key combinations? And why first 10 Fn key combinations generate scan codes? Output of commands: $ lsinput /dev/input/event7 bustype : BUS_HOST vendor : 0x0 product : 0x0 version : 0 name : "Dell WMI hotkeys" phys : "wmi/input0" bits ev : EV_SYN EV_KEY EV_MSC $ /lib/udev/keymap -i /dev/input/event7 scan code: 0x10 key code: prog3 --> Fn+Q scan code: 0x11 key code: prog3 --> Fn+W scan code: 0x12 key code: prog3 --> Fn+E scan code: 0x13 key code: prog3 --> Fn+R scan code: 0x14 key code: prog3 --> Fn+T scan code: 0x1E key code: prog3 --> Fn+A scan code: 0x1F key code: prog3 --> Fn+S scan code: 0x20 key code: prog3 --> Fn+D scan code: 0x21 key code: prog3 --> Fn+F scan code: 0x22 key code: prog3 --> Fn+G $ cat /sys/class/dmi/id/sys_vendor Dell Inc. $ cat /sys/class/dmi/id/product_name Latitude E6440 -- Pali Rohár pali.rohar@gmail.com [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Fn keys on Dell Latitude E6440 2014-04-14 14:51 Fn keys on Dell Latitude E6440 Pali Rohár @ 2014-05-04 8:25 ` Pali Rohár 2014-05-17 14:39 ` Pali Rohár 1 sibling, 0 replies; 9+ messages in thread From: Pali Rohár @ 2014-05-04 8:25 UTC (permalink / raw) To: linux-hotplug [-- Attachment #1: Type: Text/Plain, Size: 1718 bytes --] On Monday 14 April 2014 16:51:07 Pali Rohár wrote: > Hello, > > on my notebook dell-wmi kernel driver generates some scan > codes when I press some of Fn key combinations. Now all these > scan codes are mapped to key "prog3". I would like to add > some actions for these Fn key combinations, so what do you > think? Which key codes should be assigned for these scan > codes? Note that these combinations are not special (and > labeled) as other (like Fn+F11 = play/pause) and seems like > windows does not recognize them. > > Matthew, you are author of dell-wmi driver, do you know if > there are some other secrets key combinations? And why first > 10 Fn key combinations generate scan codes? > > Output of commands: > > $ lsinput > > /dev/input/event7 > bustype : BUS_HOST > vendor : 0x0 > product : 0x0 > version : 0 > name : "Dell WMI hotkeys" > phys : "wmi/input0" > bits ev : EV_SYN EV_KEY EV_MSC > > $ /lib/udev/keymap -i /dev/input/event7 > > scan code: 0x10 key code: prog3 --> Fn+Q > scan code: 0x11 key code: prog3 --> Fn+W > scan code: 0x12 key code: prog3 --> Fn+E > scan code: 0x13 key code: prog3 --> Fn+R > scan code: 0x14 key code: prog3 --> Fn+T > > scan code: 0x1E key code: prog3 --> Fn+A > scan code: 0x1F key code: prog3 --> Fn+S > scan code: 0x20 key code: prog3 --> Fn+D > scan code: 0x21 key code: prog3 --> Fn+F > scan code: 0x22 key code: prog3 --> Fn+G > > $ cat /sys/class/dmi/id/sys_vendor > Dell Inc. > > $ cat /sys/class/dmi/id/product_name > Latitude E6440 Hello, can you look at above info help me with fn keys? -- Pali Rohár pali.rohar@gmail.com [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Fn keys on Dell Latitude E6440 2014-04-14 14:51 Fn keys on Dell Latitude E6440 Pali Rohár 2014-05-04 8:25 ` Pali Rohár @ 2014-05-17 14:39 ` Pali Rohár 2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár 1 sibling, 1 reply; 9+ messages in thread From: Pali Rohár @ 2014-05-17 14:39 UTC (permalink / raw) To: linux-hotplug [-- Attachment #1: Type: Text/Plain, Size: 1815 bytes --] On Monday 14 April 2014 16:51:07 Pali Rohár wrote: > Hello, > > on my notebook dell-wmi kernel driver generates some scan > codes when I press some of Fn key combinations. Now all these > scan codes are mapped to key "prog3". I would like to add > some actions for these Fn key combinations, so what do you > think? Which key codes should be assigned for these scan > codes? Note that these combinations are not special (and > labeled) as other (like Fn+F11 = play/pause) and seems like > windows does not recognize them. > > Matthew, you are author of dell-wmi driver, do you know if > there are some other secrets key combinations? And why first > 10 Fn key combinations generate scan codes? > > Output of commands: > > $ lsinput > > /dev/input/event7 > bustype : BUS_HOST > vendor : 0x0 > product : 0x0 > version : 0 > name : "Dell WMI hotkeys" > phys : "wmi/input0" > bits ev : EV_SYN EV_KEY EV_MSC > > $ /lib/udev/keymap -i /dev/input/event7 > > scan code: 0x10 key code: prog3 --> Fn+Q > scan code: 0x11 key code: prog3 --> Fn+W > scan code: 0x12 key code: prog3 --> Fn+E > scan code: 0x13 key code: prog3 --> Fn+R > scan code: 0x14 key code: prog3 --> Fn+T > > scan code: 0x1E key code: prog3 --> Fn+A > scan code: 0x1F key code: prog3 --> Fn+S > scan code: 0x20 key code: prog3 --> Fn+D > scan code: 0x21 key code: prog3 --> Fn+F > scan code: 0x22 key code: prog3 --> Fn+G > > $ cat /sys/class/dmi/id/sys_vendor > Dell Inc. > > $ cat /sys/class/dmi/id/product_name > Latitude E6440 I looked deeper into dell-wmi driver and bios DMI keycode table. I will send patch for dell-wmi driver which adding support for Fn key combinations. -- Pali Rohár pali.rohar@gmail.com [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 0/2] dell-wmi: Add support for Fn key combinations 2014-05-17 14:39 ` Pali Rohár @ 2014-05-17 14:43 ` Pali Rohár 2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár 2014-05-17 14:43 ` [PATCH 2/2] dell-wmi: Add support for " Pali Rohár 0 siblings, 2 replies; 9+ messages in thread From: Pali Rohár @ 2014-05-17 14:43 UTC (permalink / raw) To: Dmitry Torokhov, Matthew Garrett Cc: linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett, linux-kernel, Pali Rohár This patch series add support for Fn key combinations to dell-wmi driver. I tested this patch series on laptop Dell Latitude E6440. Here is Bios DMI table which contains scancode to keycode mapping: Handle 0xB200, DMI type 178, 80 bytes OEM-specific Type Header and Data: B2 50 00 B2 07 01 0C 00 08 01 0A 00 09 01 0B 00 0A 01 12 00 3B 00 20 00 42 00 18 00 48 00 14 00 50 00 13 00 10 00 FF 00 11 00 FF 00 12 00 FF 00 13 00 FF 00 14 00 FF 00 1E 00 FF 00 1F 00 FF 00 20 00 FF 00 21 00 FF 00 22 00 FF 00 4D 00 16 00 Strings: As you can see, more different keys are mapped to one keycode 0xFF. Pali Roh√°r (2): Input: Add keycodes for some missing Fn key combinations dell-wmi: Add support for Fn key combinations drivers/platform/x86/dell-wmi.c | 27 ++++++++++++++++++++++++++- include/uapi/linux/input.h | 6 ++++++ 2 files changed, 32 insertions(+), 1 deletion(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations 2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár @ 2014-05-17 14:43 ` Pali Rohár 2014-05-17 20:30 ` Dmitry Torokhov 2014-05-17 14:43 ` [PATCH 2/2] dell-wmi: Add support for " Pali Rohár 1 sibling, 1 reply; 9+ messages in thread From: Pali Rohár @ 2014-05-17 14:43 UTC (permalink / raw) To: Dmitry Torokhov, Matthew Garrett Cc: linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett, linux-kernel, Pali Rohár There are already defined some Fn key combinations, but not all. This patch adds missing combinations for support in dell-wmi driver. Signed-off-by: Pali Roh√°r <pali.rohar@gmail.com> --- include/uapi/linux/input.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index f484952..3a32799 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -672,6 +672,12 @@ struct input_keymap_entry { #define KEY_FN_F 0x1e2 #define KEY_FN_S 0x1e3 #define KEY_FN_B 0x1e4 +#define KEY_FN_Q 0x1e5 +#define KEY_FN_W 0x1e6 +#define KEY_FN_R 0x1e7 +#define KEY_FN_T 0x1e8 +#define KEY_FN_A 0x1e9 +#define KEY_FN_G 0x1ea #define KEY_BRL_DOT1 0x1f1 #define KEY_BRL_DOT2 0x1f2 -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations 2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár @ 2014-05-17 20:30 ` Dmitry Torokhov 2014-05-17 20:38 ` Pali Rohár 0 siblings, 1 reply; 9+ messages in thread From: Dmitry Torokhov @ 2014-05-17 20:30 UTC (permalink / raw) To: Pali Rohár Cc: Matthew Garrett, linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett, linux-kernel Hi Pali, On Sat, May 17, 2014 at 04:43:36PM +0200, Pali Rohár wrote: > There are already defined some Fn key combinations, but not all. > This patch adds missing combinations for support in dell-wmi driver. > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com> > --- > include/uapi/linux/input.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h > index f484952..3a32799 100644 > --- a/include/uapi/linux/input.h > +++ b/include/uapi/linux/input.h > @@ -672,6 +672,12 @@ struct input_keymap_entry { > #define KEY_FN_F 0x1e2 > #define KEY_FN_S 0x1e3 > #define KEY_FN_B 0x1e4 > +#define KEY_FN_Q 0x1e5 > +#define KEY_FN_W 0x1e6 > +#define KEY_FN_R 0x1e7 > +#define KEY_FN_T 0x1e8 > +#define KEY_FN_A 0x1e9 > +#define KEY_FN_G 0x1ea What do they actually do? Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations 2014-05-17 20:30 ` Dmitry Torokhov @ 2014-05-17 20:38 ` Pali Rohár 2014-05-17 21:32 ` Dmitry Torokhov 0 siblings, 1 reply; 9+ messages in thread From: Pali Rohár @ 2014-05-17 20:38 UTC (permalink / raw) To: Dmitry Torokhov Cc: Matthew Garrett, linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett, linux-kernel [-- Attachment #1: Type: Text/Plain, Size: 1482 bytes --] On Saturday 17 May 2014 22:30:54 Dmitry Torokhov wrote: > Hi Pali, > > On Sat, May 17, 2014 at 04:43:36PM +0200, Pali Rohár wrote: > > There are already defined some Fn key combinations, but not > > all. This patch adds missing combinations for support in > > dell-wmi driver. > > > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com> > > --- > > > > include/uapi/linux/input.h | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/include/uapi/linux/input.h > > b/include/uapi/linux/input.h index f484952..3a32799 100644 > > --- a/include/uapi/linux/input.h > > +++ b/include/uapi/linux/input.h > > @@ -672,6 +672,12 @@ struct input_keymap_entry { > > > > #define KEY_FN_F 0x1e2 > > #define KEY_FN_S 0x1e3 > > #define KEY_FN_B 0x1e4 > > > > +#define KEY_FN_Q 0x1e5 > > +#define KEY_FN_W 0x1e6 > > +#define KEY_FN_R 0x1e7 > > +#define KEY_FN_T 0x1e8 > > +#define KEY_FN_A 0x1e9 > > +#define KEY_FN_G 0x1ea > > What do they actually do? > > Thanks. All 10 combinations Fn+Q ... Fn+T, Fn+A ... Fn+G are reported by WMI and I need to assign some keycodes for them in dell-wmi driver. And because More FN_* constants are already defined in input.h I added those which are missing. With this patch series I'm able to use above Fn combinations for my own keyboard shortcuts. Before this patch all Fn combinations were one same keycode - which was useless. -- Pali Rohár pali.rohar@gmail.com [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] Input: Add keycodes for some missing Fn key combinations 2014-05-17 20:38 ` Pali Rohár @ 2014-05-17 21:32 ` Dmitry Torokhov 0 siblings, 0 replies; 9+ messages in thread From: Dmitry Torokhov @ 2014-05-17 21:32 UTC (permalink / raw) To: Pali Rohár Cc: Matthew Garrett, linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett, linux-kernel On Sat, May 17, 2014 at 10:38:30PM +0200, Pali Rohár wrote: > On Saturday 17 May 2014 22:30:54 Dmitry Torokhov wrote: > > Hi Pali, > > > > On Sat, May 17, 2014 at 04:43:36PM +0200, Pali Rohár wrote: > > > There are already defined some Fn key combinations, but not > > > all. This patch adds missing combinations for support in > > > dell-wmi driver. > > > > > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com> > > > --- > > > > > > include/uapi/linux/input.h | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/include/uapi/linux/input.h > > > b/include/uapi/linux/input.h index f484952..3a32799 100644 > > > --- a/include/uapi/linux/input.h > > > +++ b/include/uapi/linux/input.h > > > @@ -672,6 +672,12 @@ struct input_keymap_entry { > > > > > > #define KEY_FN_F 0x1e2 > > > #define KEY_FN_S 0x1e3 > > > #define KEY_FN_B 0x1e4 > > > > > > +#define KEY_FN_Q 0x1e5 > > > +#define KEY_FN_W 0x1e6 > > > +#define KEY_FN_R 0x1e7 > > > +#define KEY_FN_T 0x1e8 > > > +#define KEY_FN_A 0x1e9 > > > +#define KEY_FN_G 0x1ea > > > > What do they actually do? > > > > Thanks. > > All 10 combinations Fn+Q ... Fn+T, Fn+A ... Fn+G are reported by > WMI and I need to assign some keycodes for them in dell-wmi > driver. If they do not have a well-defined meaning then KEY_UNKNOWN is appropriate and user later can redefine via EVIOCSKEYCODE to the code they wish. > And because More FN_* constants are already defined in > input.h I added those which are missing. I am not sure if adding existing generic KEY_FN_* was a good idea. > > With this patch series I'm able to use above Fn combinations for > my own keyboard shortcuts. Before this patch all Fn combinations > were one same keycode - which was useless. Are there not enough key definitions already to accommodate actions you want? dell-wmi supports changing keymap from usersopace so you should be able to remap entries you want to the actions you need. Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] dell-wmi: Add support for Fn key combinations 2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár 2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár @ 2014-05-17 14:43 ` Pali Rohár 1 sibling, 0 replies; 9+ messages in thread From: Pali Rohár @ 2014-05-17 14:43 UTC (permalink / raw) To: Dmitry Torokhov, Matthew Garrett Cc: linux-input, platform-driver-x86, linux-hotplug, Matthew Garrett, linux-kernel, Pali Rohár Bios DMI table contains scancodes for some Fn key combinations. But corresponding keycodes in DMI table have same value 255. And dell-wmi driver map value 255 to KEY_PROG3. This means that it is not possible to distinguish between Fn key combinations (e.g Fn+Q and Fn+W), because kernel reports for all of them only KEY_PROG3. This patch adding new table for mapping Bios DMI scancodes to linux keycodes when bios DMI keycode is set to "generic" keycode 255. So different Fn key combinations will have different keycodes. Signed-off-by: Pali Roh√°r <pali.rohar@gmail.com> --- drivers/platform/x86/dell-wmi.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 390e8e3..c54d675 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c @@ -140,7 +140,27 @@ static const u16 bios_to_linux_keycode[256] __initconst = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, KEY_PROG3 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* table for bios code 0xff */ +static const u16 scancode_to_linux_keycode[256] __initconst = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + KEY_FN_Q, KEY_FN_W, KEY_FN_E, KEY_FN_R, + KEY_FN_T, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, KEY_FN_A, KEY_FN_S, + KEY_FN_D, KEY_FN_F, KEY_FN_G, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static struct input_dev *dell_wmi_input_dev; @@ -212,6 +232,11 @@ static const struct key_entry * __init dell_wmi_prepare_new_keymap(void) keymap[i].keycode = bios_entry->keycode < 256 ? bios_to_linux_keycode[bios_entry->keycode] : KEY_RESERVED; + if (bios_entry->keycode = 255 && bios_entry->scancode < 256) + keymap[i].keycode + scancode_to_linux_keycode[bios_entry->scancode]; + if (!keymap[i].keycode) + keymap[i].keycode = KEY_RESERVED; } keymap[hotkey_num].type = KE_END; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-05-17 21:32 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-04-14 14:51 Fn keys on Dell Latitude E6440 Pali Rohár 2014-05-04 8:25 ` Pali Rohár 2014-05-17 14:39 ` Pali Rohár 2014-05-17 14:43 ` [PATCH 0/2] dell-wmi: Add support for Fn key combinations Pali Rohár 2014-05-17 14:43 ` [PATCH 1/2] Input: Add keycodes for some missing " Pali Rohár 2014-05-17 20:30 ` Dmitry Torokhov 2014-05-17 20:38 ` Pali Rohár 2014-05-17 21:32 ` Dmitry Torokhov 2014-05-17 14:43 ` [PATCH 2/2] dell-wmi: Add support for " Pali Rohár
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).