How to remap Fn key combinations (Lenovo G500)

Posted by Anatoli on Ask Ubuntu See other posts from Ask Ubuntu or by Anatoli
Published on 2013-11-08T18:16:43Z Indexed on 2013/11/11 16:16 UTC
Read the original article Hit count: 315

Filed under:
|

I am running Kubuntu 13.10 on a Lenovo G500 laptop.

My question is similar to this one: How can I remap my F keys on my HP laptop?

That is to say, my F1-F12 keys are mapped to certain special functions, and only holding down the Fn key restores access to the standard F1-F12 keys. How do I remap certain keys?

I would like to know if there is a way to remap Fx to Fn+Fx and vice-versa. As per the instructions of #87043 I checked my BIOS and there is no option to switch the Fx/Fn key functionality.

Googling through Leonovo's support forums indicates a BIOS update enabling this is in the works, but there's no indication of when it will be complete.

Using xev I was able to see what X sees when F1-F12 are pressed. Some send separate keycodes, but some are somehow mapped to key combinations or other unknown things:

F1 - XF86AudioMute

F2 - XF86AudioVolumeLower

F3 - XF86AudioVolumeRaise

F4 - Alt_L + F4

F5 - F5

F6 - Disables touchapd, cannot quite understand what xev tells me is happening, reenables if disabled (Kernel log reveals these have well-defined scancodes not assigned to any keycodes)

F7 - XF86WLAN

F8 - Alt_L + Ctrl_L + Tab

F9 - Turns off LCD backlight, xev sees nothing

F10 - Super_L + p

F11 - XF86MonBrightnessLower

F12 - XF86MonBrightnessRaise

Following the instrusctions on this page: How do I remap certain keys?

I remapped all the keys that have definite keycodes (F1, F2, F3, F5, F7, F11, F12) This still leaves the F4, F6, F8, F9, F10 keys not functioning properly.

This is especially frustarting since F4, F6, F9 now kill the current window, the touchpad and screen, respectively.

Any help on remapping these keys to their proper functions would be much appreciated! -Anatoli

xev output for these 5 keys:

F4

KeyPress event, serial 40, synthetic NO, window 0x4800001,
    root 0x9d, subw 0x0, time 3674037, (228,298), root:(911,321),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 40, synthetic NO, window 0x4800001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 40, synthetic NO, window 0x4800001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  4294967197 0   0   0   0   0   0   0   65  0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 40, synthetic NO, window 0x4800001,
    root 0x9d, subw 0x0, time 3674040, (228,298), root:(911,321),
    state 0x8, keycode 70 (keysym 0xffc1, F4), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4800001,
    root 0x9d, subw 0x0, time 3674042, (228,298), root:(911,321),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

ClientMessage event, serial 40, synthetic YES, window 0x4800001,
    message_type 0x12a (WM_PROTOCOLS), format 32, message 0x12b (WM_DELETE_WINDOW)

F6 disabling touchpad

MappingNotify event, serial 40, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

FocusOut event, serial 40, synthetic NO, window 0x4600001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 40, synthetic NO, window 0x4600001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

MappingNotify event, serial 41, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

F6 enabling touchpad

MappingNotify event, serial 42, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

FocusOut event, serial 42, synthetic NO, window 0x4600001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 42, synthetic NO, window 0x4600001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 42, synthetic NO, window 0x0,
    keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

MappingNotify event, serial 43, synthetic NO, window 0x0,
    request MappingPointer, first_keycode 0, count 0

F8 doing whatever it is F8 does

KeyPress event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3508985, (13,-12), root:(696,11),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3508986, (13,-12), root:(696,11),
    state 0x8, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3508988, (13,-12), root:(696,11),
    state 0xc, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XmbLookupString gives 1 bytes: (09) "       "
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3508989, (13,-12), root:(696,11),
    state 0xc, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3508991, (13,-12), root:(696,11),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3508994, (13,-12), root:(696,11),
    state 0x0, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XFilterEvent returns: False

F9 gives no output to xev

F10 doing whatever it is F10 does

KeyRelease event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3586076, (9,-14), root:(692,9),
    state 0x0, keycode 10 (keysym 0x31, 1), same_screen YES,
    XLookupString gives 1 bytes: (31) "1"
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3586552, (9,-14), root:(692,9),
    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3586554, (9,-14), root:(692,9),
    state 0x40, keycode 33 (keysym 0x70, p), same_screen YES,
    XLookupString gives 1 bytes: (70) "p"
    XmbLookupString gives 1 bytes: (70) "p"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3586557, (9,-14), root:(692,9),
    state 0x40, keycode 33 (keysym 0x70, p), same_screen YES,
    XLookupString gives 1 bytes: (70) "p"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4600001,
    root 0x9d, subw 0x0, time 3586560, (9,-14), root:(692,9),
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

© Ask Ubuntu or respective owner

Related posts about keyboard-layout

Related posts about xmodmap