Skip to contentSkip to conversation

Mapping of F11 and F12 on new lenovo laptops and Lenovo Compact Keyboard

DISCUSSION Hans de Goede 2 participants 4 messages Jun 19, 2014 – Jun 21, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Jamie,

I saw your patch-set for the Lenovo Compact Keyboard on the lwn.net kernel page.

This spiked my interest as I'm the author of this patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=8b9dd4fab26a0f328420cbda0845a325f45bcd92

Which adds mapping for the F9 - F12 on the Lenovo *40 series laptops, which have the same weird symbols on F11 and F12 as the Lenovo Compact Keyboard, the ones which you describe as:

/* Fn-F11: View open applications (3 boxes) */
/* Fn-F12: Open My computer (6 boxes) USB-only */

You map these to:
KEY_FN_F11
KEY_FILE

Where as my (already merged into Linus tree) patch maps these to:

KEY_SCALE
KEY_COMPUTER

Which are defined in linux/uapi/input.h as:

#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
#define KEY_COMPUTER 157

Which I believe maps closes to View open applications (which to me sounds like expose mode) and Open My computer.

Note that on the laptops the keys have their special meaning by default and using Fn turns them back into normal F11 keys, so KEY_FN_F11 seems like a particular bad match as that suggests a key combo which it is not on the laptops.

Anyways lets discuss and coordinate, so that we end up with the same mappings for the weird symbols on F11 and F12 for the laptops and for the Lenovo Compact Keyboard.

Regards,

Hans

#1 lore raw
Quoted 24 lines · Hans de Goede

Hi Jamie,

I saw your patch-set for the Lenovo Compact Keyboard on the lwn.net kernel page.

This spiked my interest as I'm the author of this patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=8b9dd4fab26a0f328420cbda0845a325f45bcd92

Which adds mapping for the F9 - F12 on the Lenovo *40 series laptops, which have the same weird symbols on F11 and F12 as the Lenovo Compact Keyboard, the ones which you describe as:

/* Fn-F11: View open applications (3 boxes) */
/* Fn-F12: Open My computer (6 boxes) USB-only */

You map these to:
KEY_FN_F11
KEY_FILE

Where as my (already merged into Linus tree) patch maps these to:

KEY_SCALE
KEY_COMPUTER

Quoted 7 lines

Which are defined in linux/uapi/input.h as:

#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
#define KEY_COMPUTER 157

Which I believe maps closes to View open applications (which to me sounds like expose mode) and Open My computer.

Yes, the Function keys look the same:-
http://www.lenovo.com/images/gallery/1060x596/lenovo-laptop-thinkpad-t440-overhead-keyboard-2.jpg
https://c2.staticflickr.com/6/5467/9092693533_440cfcf311_z.jpg

I went with KEY_FILE on the USB keyboard, since this is what it's mapped to on the Bluetooth keyboard, as part of the CONSUMER usage page:-
http://lxr.free-electrons.com/source/drivers/hid/hid-input.c#L694

Personally I've no fondness to what the keys map to, since I remap them to how they are labelled on an Thinkpad X230, which is pause/nexttrack. However, it seems somewhat silly customising something that appears to be a standard mapping.

Quoted 4 lines

Note that on the laptops the keys have their special meaning by default and using Fn turns them back into normal F11 keys, so KEY_FN_F11 seems like a particular bad match as that suggests a key combo which it is not on the laptops.

That's true. It works fine with Fn-ESC but yes, on these keyboards they are labelled such that F11 is the Fn-modified version.

Quoted 3 lines

Anyways lets discuss and coordinate, so that we end up with the same mappings for the weird symbols on F11 and F12 for the laptops and for the Lenovo Compact Keyboard.

I think there are also some Apple keyboards using the same symbols, it might be worth seeing if these are supported and what they produce.

Quoted 6 lines

Regards,

Hans

Signature · 1 line
Jamie Lentin
#2 lore raw

Hi,

Quoted 34 lines · Jamie Lentin
Quoted 24 lines · Hans de Goede

Hi Jamie,

I saw your patch-set for the Lenovo Compact Keyboard on the lwn.net kernel page.

This spiked my interest as I'm the author of this patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=8b9dd4fab26a0f328420cbda0845a325f45bcd92

Which adds mapping for the F9 - F12 on the Lenovo *40 series laptops, which have the same weird symbols on F11 and F12 as the Lenovo Compact Keyboard, the ones which you describe as:

/* Fn-F11: View open applications (3 boxes) */
/* Fn-F12: Open My computer (6 boxes) USB-only */

You map these to:
KEY_FN_F11
KEY_FILE

Where as my (already merged into Linus tree) patch maps these to:

KEY_SCALE
KEY_COMPUTER

Quoted 7 lines

Which are defined in linux/uapi/input.h as:

#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
#define KEY_COMPUTER 157

Which I believe maps closes to View open applications (which to me sounds like expose mode) and Open My computer.

Quoted 6 lines

Yes, the Function keys look the same:-
http://www.lenovo.com/images/gallery/1060x596/lenovo-laptop-thinkpad-t440-overhead-keyboard-2.jpg
https://c2.staticflickr.com/6/5467/9092693533_440cfcf311_z.jpg

I went with KEY_FILE on the USB keyboard, since this is what it's mapped to on the Bluetooth keyboard, as part of the CONSUMER usage page:-
http://lxr.free-electrons.com/source/drivers/hid/hid-input.c#L694

Ah, well if the bluetooth version of the keyboard actually uses a standard HUT code for that and that maps to KEY_FILE, then I agree that it would be best to map the "F-12" key to KEY_FILE.

Quoted 8 lines

Personally I've no fondness to what the keys map to, since I remap them to how they are labelled on an Thinkpad X230, which is pause/nexttrack. However, it seems somewhat silly customising something that appears to be a standard mapping.

Quoted 4 lines

Note that on the laptops the keys have their special meaning by default and using Fn turns them back into normal F11 keys, so KEY_FN_F11 seems like a particular bad match as that suggests a key combo which it is not on the laptops.

That's true. It works fine with Fn-ESC but yes, on these keyboards they are labelled such that F11 is the Fn-modified version.

Right so lets just go with KEY_SCALE then? If you switch F-11 to KEY_SCALE in the next version of your patch set, then I'll send a followup patch for thinkpad-acpi to change F-12 to KEY_FILE, and then the 2 mappings will be in sync.

Agreed ?

Regards,

Hans

#3 lore raw
Quoted 55 lines · Hans de Goede

Hi,

Quoted 34 lines · Jamie Lentin
Quoted 24 lines · Hans de Goede

Hi Jamie,

I saw your patch-set for the Lenovo Compact Keyboard on the lwn.net kernel page.

This spiked my interest as I'm the author of this patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=8b9dd4fab26a0f328420cbda0845a325f45bcd92

Which adds mapping for the F9 - F12 on the Lenovo *40 series laptops, which have the same weird symbols on F11 and F12 as the Lenovo Compact Keyboard, the ones which you describe as:

/* Fn-F11: View open applications (3 boxes) */
/* Fn-F12: Open My computer (6 boxes) USB-only */

You map these to:
KEY_FN_F11
KEY_FILE

Where as my (already merged into Linus tree) patch maps these to:

KEY_SCALE
KEY_COMPUTER

Quoted 7 lines

Which are defined in linux/uapi/input.h as:

#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
#define KEY_COMPUTER 157

Which I believe maps closes to View open applications (which to me sounds like expose mode) and Open My computer.

Quoted 6 lines

Yes, the Function keys look the same:-
http://www.lenovo.com/images/gallery/1060x596/lenovo-laptop-thinkpad-t440-overhead-keyboard-2.jpg
https://c2.staticflickr.com/6/5467/9092693533_440cfcf311_z.jpg

I went with KEY_FILE on the USB keyboard, since this is what it's mapped to on the Bluetooth keyboard, as part of the CONSUMER usage page:-
http://lxr.free-electrons.com/source/drivers/hid/hid-input.c#L694

Ah, well if the bluetooth version of the keyboard actually uses a standard HUT code for that and that maps to KEY_FILE, then I agree that it would be best to map the "F-12" key to KEY_FILE.

Quoted 7 lines

Personally I've no fondness to what the keys map to, since I remap them to how they are labelled on an Thinkpad X230, which is pause/nexttrack. However, it seems somewhat silly customising something that appears to be a standard mapping.

Quoted 4 lines

Note that on the laptops the keys have their special meaning by default and using Fn turns them back into normal F11 keys, so KEY_FN_F11 seems like a particular bad match as that suggests a key combo which it is not on the laptops.

Quoted 8 lines
Quoted 1 line

That's true. It works fine with Fn-ESC but yes, on these keyboards they are labelled such that F11 is the Fn-modified version.

Right so lets just go with KEY_SCALE then? If you switch F-11 to KEY_SCALE in the next version of your patch set, then I'll send a followup patch for thinkpad-acpi to change F-12 to KEY_FILE, and then the 2 mappings will be in sync.

Agreed ?

Seems like a fair compromise :) I'll do that (use KEY_SCALE / KEY_FILE) in the next version of the patch.

Quoted 5 lines

Regards,

Hans

Signature · 1 line
Jamie Lentin