Discussion:
Fn keys on Dell Latitude E6440
Pali Rohár
2014-04-14 14:51:07 UTC
Permalink
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
***@gmail.com
Pali Rohár
2014-05-04 08:25:01 UTC
Permalink
Post by Pali Rohár
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?
$ 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
***@gmail.com
Pali Rohár
2014-05-17 14:39:45 UTC
Permalink
Post by Pali Rohár
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?
$ 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
***@gmail.com
Pali Rohár
2014-05-17 14:43:35 UTC
Permalink
This patch series add support for Fn key combinations to dell-wmi drive=
r.
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=C3=A1r (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(-)

--=20
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-input" =
in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Pali Rohár
2014-05-17 14:43:36 UTC
Permalink
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=C3=A1r <***@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
=20
#define KEY_BRL_DOT1 0x1f1
#define KEY_BRL_DOT2 0x1f2
--=20
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug=
" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov
2014-05-17 20:30:54 UTC
Permalink
Hi Pali,
Post by 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.
=20
---
include/uapi/linux/input.h | 6 ++++++
1 file changed, 6 insertions(+)
=20
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.

--=20
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" =
in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Pali Rohár
2014-05-17 20:38:30 UTC
Permalink
Post by Dmitry Torokhov
Hi Pali,
Post by 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.
---
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
***@gmail.com
Dmitry Torokhov
2014-05-17 21:32:48 UTC
Permalink
Post by Dmitry Torokhov
Hi Pali,
=20
Post by 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.
=20
---
=20
include/uapi/linux/input.h | 6 ++++++
1 file changed, 6 insertions(+)
=20
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 {
=20
#define KEY_FN_F 0x1e2
#define KEY_FN_S 0x1e3
#define KEY_FN_B 0x1e4
=20
+#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
=20
What do they actually do?
=20
Thanks.
=20
All 10 combinations Fn+Q ... Fn+T, Fn+A ... Fn+G are reported by=20
WMI and I need to assign some keycodes for them in dell-wmi=20
driver.=20
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=20
input.h I added those which are missing.
I am not sure if adding existing generic KEY_FN_* was a good idea.
=20
With this patch series I'm able to use above Fn combinations for=20
my own keyboard shortcuts. Before this patch all Fn combinations=20
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 b=
e
able to remap entries you want to the actions you need.

Thanks.

--=20
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" =
in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Pali Rohár
2014-05-17 14:43:37 UTC
Permalink
Bios DMI table contains scancodes for some Fn key combinations. But
corresponding keycodes in DMI table have same value 255. And dell-wmi d=
river
map value 255 to KEY_PROG3. This means that it is not possible to disti=
nguish
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 key=
codes
when bios DMI keycode is set to "generic" keycode 255. So different Fn =
key
combinations will have different keycodes.

Signed-off-by: Pali Roh=C3=A1r <***@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/del=
l-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] __init=
const =3D {
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 =3D {
+ 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
};
=20
static struct input_dev *dell_wmi_input_dev;
@@ -212,6 +232,11 @@ static const struct key_entry * __init dell_wmi_pr=
epare_new_keymap(void)
keymap[i].keycode =3D bios_entry->keycode < 256 ?
bios_to_linux_keycode[bios_entry->keycode] :
KEY_RESERVED;
+ if (bios_entry->keycode =3D=3D 255 && bios_entry->scancode < 256)
+ keymap[i].keycode =3D
+ scancode_to_linux_keycode[bios_entry->scancode];
+ if (!keymap[i].keycode)
+ keymap[i].keycode =3D KEY_RESERVED;
}
=20
keymap[hotkey_num].type =3D KE_END;
--=20
1.7.9.5
Continue reading on narkive:
Loading...