Asking the GNU/Linux God
-
- programmer
- Posts: 156
- Joined: Mon May 23, 2005 9:46 am
- Location: Prague, Czech Republic
- Contact:
Asking the GNU/Linux God
I now bow down in piety to the Linux God that goes under the name of...
VOID MAIN
As a rule, I never bother your divine presence, unless in dire need. Indeed.
But the worst has come and no one else can provide. No guide.
What I need is a merge between one keyboard and one more. Nevermore...
How can I edit a particular key to give a particular keysym? I need to replace the number keys with Czech accent keys because there is no Czech version of dvorak. Call me stupid (your highness), but I just can't figure xmodmap out - I only managed to screw up my existing QWERTZ Czech layout...
VOID MAIN
As a rule, I never bother your divine presence, unless in dire need. Indeed.
But the worst has come and no one else can provide. No guide.
What I need is a merge between one keyboard and one more. Nevermore...
How can I edit a particular key to give a particular keysym? I need to replace the number keys with Czech accent keys because there is no Czech version of dvorak. Call me stupid (your highness), but I just can't figure xmodmap out - I only managed to screw up my existing QWERTZ Czech layout...
Didn't you read the disclaimer when you signed up about no religion? :) Actually it's pretty easy, I use it to switch the CTRL and CapsLock keys on my Sun keyboard at work (they're reversed from PC layout). To see what your current settings are just do "xmodmap -pke". You should see the number key assignments at around "keycode 10" through "keycode 19". Say you wanted to switch your 4 and 5 keys (and their shift values) which on my system are defaulted to this:
keycode 13 = 4 dollar
keycode 14 = 5 percent
You can reverse them by:
Or just put this in your ~/.Xmodmap:
keycode 14 = 4 dollar
keycode 13 = 5 percent
Remember once you set one key to what the other key is you lose control of they will both be assigned the same thing so you won't be able to use that number if you are trying to do it interactively. You'll have to either use your numberpad (which gives different key codes) or put your commands in a script, or put them in your ~/.Xmodmap as stated. It's all pretty well explained in the man page:
http://www.xfree86.org/4.2.0/xmodmap.1.html
keycode 13 = 4 dollar
keycode 14 = 5 percent
You can reverse them by:
Code: Select all
xmodmap -e "keycode 14 = 4 dollar"
xmodmap -e "keycode 13 = 5 percent"
keycode 14 = 4 dollar
keycode 13 = 5 percent
Remember once you set one key to what the other key is you lose control of they will both be assigned the same thing so you won't be able to use that number if you are trying to do it interactively. You'll have to either use your numberpad (which gives different key codes) or put your commands in a script, or put them in your ~/.Xmodmap as stated. It's all pretty well explained in the man page:
http://www.xfree86.org/4.2.0/xmodmap.1.html
-
- programmer
- Posts: 156
- Joined: Mon May 23, 2005 9:46 am
- Location: Prague, Czech Republic
- Contact:
Thank you thank you I grovel in the dust before you damn that's so easy I should've figured it out...
I thought that meant no other religion.
You mentioned the Capslock thing before (remember the dvorak debate?).
I'm aware that I'll lose the numbers: I consider them redundant, since we have the numpad.
And how do you make it update to the new modmap file?
I thought that meant no other religion.
You mentioned the Capslock thing before (remember the dvorak debate?).
I'm aware that I'll lose the numbers: I consider them redundant, since we have the numpad.
And how do you make it update to the new modmap file?
The ~/.Xmodmap is the file where your cutomizations reside. This will get installed at logon (may be Red Hat/Fedora specific but I don't think so). Otherwise if it does't you can issue "xmodmap ~/.Xmodmap" which will apply them. You can create a default one with:
xmodmap -pke > ~/.Xmodmap
and then modify the file to your liking.
xmodmap -pke > ~/.Xmodmap
and then modify the file to your liking.
-
- programmer
- Posts: 156
- Joined: Mon May 23, 2005 9:46 am
- Location: Prague, Czech Republic
- Contact:
OK. Thanks a bunch.
BTW in Ubuntu, it would seem that all the modmaps are stored centrally (/usr/share/xmodmap/xmodmap.dvorak in my case), not in the users' directories.
I now have a fully functional Czech-English Dvorak Layout.
Wait... no, not fully functional.
There's one more thing. The Czech keyboard has two special characters, the caron (ˇ) and the acute (´), which are applied above letters (ěščřžýáíé) by being pressed before the letter in question. I asigned the two to keys, but they are now placed immediately after the keystroke (ˇc instead of č).
Would you know how to fix this? (My souvereign?)
BTW in Ubuntu, it would seem that all the modmaps are stored centrally (/usr/share/xmodmap/xmodmap.dvorak in my case), not in the users' directories.
I now have a fully functional Czech-English Dvorak Layout.
Wait... no, not fully functional.
There's one more thing. The Czech keyboard has two special characters, the caron (ˇ) and the acute (´), which are applied above letters (ěščřžýáíé) by being pressed before the letter in question. I asigned the two to keys, but they are now placed immediately after the keystroke (ˇc instead of č).
Would you know how to fix this? (My souvereign?)
Not off the top of my head but I can check into it later. Regarding the file you edited, that is the system wide xmodmap. Red Hat/Fedora also has a system wide xmodmap but I personally wouldn't change unless everyone using it wants the same keymap. Of course you are probably the only one using it. :)
-
- programmer
- Posts: 156
- Joined: Mon May 23, 2005 9:46 am
- Location: Prague, Czech Republic
- Contact:
God?
...
Void?
...
Are you there?
...
I grovel on the ground before you, in the gravel on the ground under your feet an' all, but I have one more cheeky question to ask.
Whenever I use xmodmap to switch between layouts, most of my keyboard shortcuts cease to work. It seems to me that anything that involves modifier keys is simply ignored (Ctrl+Alt+F1 to switch consoles, Ctrl+Alt+cursorkey to witch workspaces), and yet I think the xmodmap files are right with the mods and all, and Ctrl+Alt+Bcksp works fine (I think). It gets back to normal after reboot (and presumably a Ctrl+Alt+Bcksp).
Do you have any idea, in your immensely broad and yet deep knowledge and wisdom... blah blah blah ?
Thanks,
Jenda
...
Void?
...
Are you there?
...
I grovel on the ground before you, in the gravel on the ground under your feet an' all, but I have one more cheeky question to ask.
Whenever I use xmodmap to switch between layouts, most of my keyboard shortcuts cease to work. It seems to me that anything that involves modifier keys is simply ignored (Ctrl+Alt+F1 to switch consoles, Ctrl+Alt+cursorkey to witch workspaces), and yet I think the xmodmap files are right with the mods and all, and Ctrl+Alt+Bcksp works fine (I think). It gets back to normal after reboot (and presumably a Ctrl+Alt+Bcksp).
Do you have any idea, in your immensely broad and yet deep knowledge and wisdom... blah blah blah ?
Thanks,
Jenda
-
- programmer
- Posts: 156
- Joined: Mon May 23, 2005 9:46 am
- Location: Prague, Czech Republic
- Contact:
Edit: I'll paste it in the Ubuntu pastebin:
xmodmap.dvorak: http://paste.ubuntulinux.nl/4800
xmodmap.dvorakcz: http://paste.ubuntulinux.nl/4799
xmodmap -pke: http://paste.ubuntulinux.nl/4798
I didn't find anything strange. Could be my stupidity, though.
xmodmap.dvorak: http://paste.ubuntulinux.nl/4800
xmodmap.dvorakcz: http://paste.ubuntulinux.nl/4799
xmodmap -pke: http://paste.ubuntulinux.nl/4798
I didn't find anything strange. Could be my stupidity, though.
It seems odd that a lot of your shifted key codes are missing. Maybe it would be better to compare the output of the "dumpkeys" command. Another nice graphical utility for this is XKeyCaps:
http://www.jwz.org/xkeycaps/
You can use this tool to edit keys, swap keys, restore defaults of keys, and write out a keyboard map. Run the program, select your keyboard, right-click on the keys you want to manipulate. I think I'll make an RPM for this. Also, it's manual has some nice explanations of modifiers, etc:
http://www.jwz.org/xkeycaps/man.html
http://www.jwz.org/xkeycaps/
You can use this tool to edit keys, swap keys, restore defaults of keys, and write out a keyboard map. Run the program, select your keyboard, right-click on the keys you want to manipulate. I think I'll make an RPM for this. Also, it's manual has some nice explanations of modifiers, etc:
http://www.jwz.org/xkeycaps/man.html
Hmmm, I just used xkeycaps without a problem. I also just built an RPM for it. For dumpkeys just type "dumpkeys". You can redirect the output to a file with a working setup and also with the non-working setup. Have you tried just commenting out these lines?
Use an "!" in the first column to comment.
Code: Select all
clear Mod1
clear Mod2
keycode 116 = Mode_switch
keycode 117 = Multi_key
add Mod1 = Alt_L
add Mod2 = Mode_switch
-
- programmer
- Posts: 156
- Joined: Mon May 23, 2005 9:46 am
- Location: Prague, Czech Republic
- Contact:
OK: In the end I got xkeycaps working. It's a bug concerning Numlock, and for some reason it didn't work to just press Numlock before - now it did.
With that, I managed to create the proper settings. Done. Finito. Everything works. I thank you for your help - and patience. I will never have another god before you. Or at least not more than five or so.
With that, I managed to create the proper settings. Done. Finito. Everything works. I thank you for your help - and patience. I will never have another god before you. Or at least not more than five or so.