Lenovo keyboards and the FN key. Still no way to remap?
Paul Johnson
pauljohn32 at gmail.com
Wed Nov 19 17:43:11 UTC 2008
In Ubuntu 8.10, there is some hope that the FN key might be remapped
on the Lenovo laptop. I have a T61, but from what I can see, all
Lenovo/IBM think pads have this weird keyboard where the FN and Ctrl
keys are swapped. This causes a lot of inconvenience for users (just
google) and there seems to be hope that Lenovo might make a bios
switch to swap the 2 keys. Until then, I'm trying to see if I can't
get it done with xmodmap and I'm having limited success.
Perhaps this note finds somebody who has worked on keyboards who can
help. As far as I can see, here's the situation.
The keyboard choice T61 is available under the Gnome menu
System->Preferences->Keyboard. That keyboard diagram DOES NOT SHOW
the FN key, however. But the FN key does work "out of the box" for
me. It can suspend, darken the screen, do all the stuff they want.
Some posters in this list have claimed that the FN key is somehow
hardwired and there is no software solution. They claim the key does
not even register an event in the X server. But that is not true in
Ubuntu 8.10. Observe the output from xev when I hit the FN and the
Control Key.
PropertyNotify event, serial 31, synthetic NO, window 0x3200001,
atom 0x16f (_NET_WM_ICON_GEOMETRY), time 630794, state PropertyNewValue
KeyPress event, serial 31, synthetic NO, window 0x3200001,
root 0x13b, subw 0x0, time 634901, (163,-15), root:(1613,45),
state 0x0, keycode 151 (keysym 0x1008ff2b, XF86WakeUp), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x3200001,
root 0x13b, subw 0x0, time 634912, (163,-15), root:(1613,45),
state 0x0, keycode 151 (keysym 0x1008ff2b, XF86WakeUp), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 34, synthetic NO, window 0x3200001,
root 0x13b, subw 0x0, time 636965, (163,-15), root:(1613,45),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x3200001,
root 0x13b, subw 0x0, time 637204, (163,-15), root:(1613,45),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
This seems to indicate that the FN key registers "XF86WakeUp". In
the xmodmap instructions, there is an example of swapping the control
key and the caps lock key.
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
That does work. So I tried to adapt that approach to switch the FN
and CTRL keys like so:
remove Control = Control_L
keysym Control_L = XF86WakeUp
keysym XF86WakeUp = Control_L
add Control = Control_L
After I do that, neither the FN nor the left CTRL key work at all. I
mean, they don't have any effect. They DO give off results in xev,
however.
The FN key (keycode 151) now properly says it is Control_L :
yPress event, serial 31, synthetic NO, window 0x3800001,
root 0x13b, subw 0x0, time 2032867, (166,-17), root:(578,80),
state 0x0, keycode 151 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x3800001,
root 0x13b, subw 0x0, time 2032878, (166,-17), root:(578,80),
state 0x4, keycode 151 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
And the FN key (keycode 37) correctly says it is XF86WakeUp:
KeyPress event, serial 34, synthetic NO, window 0x3800001,
root 0x13b, subw 0x0, time 2039856, (166,-17), root:(578,80),
state 0x0, keycode 37 (keysym 0x1008ff2b, XF86WakeUp), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x3800001,
root 0x13b, subw 0x0, time 2040008, (166,-17), root:(578,80),
state 0x0, keycode 37 (keysym 0x1008ff2b, XF86WakeUp), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
If you have any evidence that remapping is "impossible", please let me
know. I've found a lot of people guessing about the problem, but
depressingly little actual knowledge.
PJ
--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
More information about the ubuntu-users
mailing list