9
7
Problem: I want to modify/redefine my keyboard layout (pc105 se) so that when I press certain keys with mod3 (super) and mod4 (hyper), a different character is returned than usual.
E.g.
Keycode 61 produces 'minus' (-) when pressed normally and 'underscore' (_) when pressed with shift. When pressed with the first modifier group (AltGr) 'dead_belowdot' and 'dead_abovedot' is produced (without/with shift).
What I want is a left paranthesis or right paranthesis (without/with shift) when I press the key with the Super (win) key also pressed, and slash/backslash for the Hyper key (which I have configured to Caps Lock).
I have tried to add a .Xmodmap
to my home directory and run it with
xmodmap ~/.Xmodmap
using the following syntax
keycode 61 = minus underscore a b c d e f g h i j k l m n o p
However, that will cause AltGr to result in c/d, while win/caps lock still only results in -/_
I have also tried modifying /usr/share/X11/xkb/symbols/se directly and tried the following changes:
key <BKSL> { [apostrophe, asterisk, acute, multiply], [a,b,c,d], [e,f,g,h], [i,j,k,l]};
But all that happens is ' * ´ × ' * ' * (for normal, altgr, win and caps lock respectively). I have also tried
key <BKSL> { [apostrophe, asterisk, acute, multiply, a,b,c,d, e,f,g,h, i,j,k,l]};
But as soon as there are more than four specified fields, it seems to break the key totaly, and the key reverts to default pc105 (us?) behaviour.
As I have failed to find anything on stackoverflow, superuser or google on how to deal with my scenario, I ask here.
This is my xmodmap -pm
xmodmap: up to 3 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3 Hyper_L (0x42), Hyper_L (0xcf)
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
I'm still curious why the default AltGr won't work for all keys the same way... http://unix.stackexchange.com/questions/249122/why-do-my-xmodmap-binds-involving-altgr-only-work-on-some-keys
– Pavel Šimerda – 2016-10-01T18:55:16.0702If you find anything could you please post your answer here? (that is: answering your own question). I'm amazed by how complicated such a trivial task seems to be and there's hardly any info on the net. It's just crazy. – Cedric Martin – 2012-08-07T18:33:16.243
I will. But for now, I'm still only at the stage of trial-and-error and constant manual reading. – Aron Cederholm – 2012-08-13T11:49:34.683