You are not logged in.
I have a Lenovo ThinkPad E125 laptop and it has an unusual keyboard: its "Fn" key has keycode 29 and works as "Ctrl" in the default layout, while "Ctrl" has keycode 143.
I tried to edit /usr/share/kbd/keymaps/i386/qwerty/us.map.gz and add the following lines:
keycode 29 =
keycode 133 = Compose
keycode 143 = ControlHowever, it doesn't work for me. (N.B. I've never worked with layouts before.)
What is the right way to change the situation?
Update: it has nothing to do with the operating system. Ctrl and Fn can be switched via BIOS setup.
Last edited by lyoshab (2012-01-19 09:20:55)
Offline
Have a look at xmodmap. With this you can remap keys.
xmodmap is for X. I need a solution that doesn't involve X, or an explanation why it is not possible.
Also, xev gives keycode 151 for the left "Ctrl" key. Putting
keycode 151 = Control_L NoSymbol Control_Ldoesn't work for me. Here's what xev says after that change:
KeyRelease event, serial 34, synthetic NO, window 0x1800001,
root 0x14e, subw 0x0, time 4861486, (129,103), root:(723,422),
state 0x4, keycode 151 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseBut Left Ctrl + C gives
KeyPress event, serial 34, synthetic NO, window 0x1800001,
root 0x14e, subw 0x0, time 2976950, (138,134), root:(372,451),
state 0x0, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: FalseLeft Ctrl + X doesn't work in Emacs, etc.
So I don't think I know how to fix this via xmodmap either.
Last edited by lyoshab (2012-01-11 13:42:46)
Offline
I have a Lenovo ThinkPad E125 laptop and it has an unusual keyboard: its "Fn" key has keycode 29 and works as "Ctrl" in the default layout, while "Ctrl" has keycode 143.
I tried to edit /usr/share/kbd/keymaps/i386/qwerty/us.map.gz and add the following lines:
keycode 29 = keycode 133 = Compose keycode 143 = ControlHowever, it doesn't work for me. (N.B. I've never worked with layouts before.)
What is the right way to change the situation?
Whoops. I guess I don't understand how things work. Putting something like "keycode 143 = one" in us.map has the expected effect (the "Ctrl" key generates "1"). Putting something like "keycode 58 = Control" also works (assigning Control for "CapsLock" key). But "keycode 143 = Control" fails.
Last edited by lyoshab (2012-01-11 15:11:00)
Offline
Offline
Well, the initial post actually refers to loadkeys. I am trying to make my keymap based on the default version of /usr/share/kbd/keymaps/i386/qwerty/us.map
But here is the problem: the key that marked as "Ctrl" on my laptop generates a weird keycode 143. For some reason, I can assign characters to it, but not Control. I tried to assign Control to other keycodes like 58 or 44 and it works. So my guess is that "large" codes as 143 are treated in some specific way.
Last edited by lyoshab (2012-01-13 04:39:44)
Offline
Sorry, should've read more carefully. Probably a stupid question, but have you run
# locale-genafter your changes?
Offline
Sorry, should've read more carefully. Probably a stupid question, but have you run
# locale-genafter your changes?
Doesn't help. (Has it something to do with /usr/share/kbd/keymaps?) My locale is just en_US.UTF-8.
Last edited by lyoshab (2012-01-13 15:51:11)
Offline
Did you check your BIOS settings, there is an option for switching Fn and Ctrl, it might be activated and confusing linux.
Offline
Did you check your BIOS settings, there is an option for switching Fn and Ctrl, it might be activated and confusing linux.
\o/ Thank you very much! So it has nothing to do with the operating system.
Offline