Xmodmap mod keys
Is it possible to make a key print a different character while a certain other key is pressed using xmodmap?
|
Anyone?
|
AFAIK, only when the other key is a modifier one (ie. shift, mode_switch or both) but I guess you already know that ...
By the way, bumping your own thread with your "Anyone" comment had an opposite effect than the one you were expecting. Zero replies threads are automatically bumped up several times but of course only if they still have no reply. |
Quote:
|
Usually the one with ALT-GR on it.
Code:
xmodmap -pm |
My keyboard does not have an Alt Gr key on it.
Code:
$ xmodmap -pm |
That's mod5 anyway.
|
What does mod5 do?
I really with there was some good xmodmap reference somewhere but I just can't find one. |
Mod5 is modifying what a key will send, just like shift + 'a' will make 'A' instead of a lowercase 'a'.
Have a look at the Mappings paragraph here: http://en.wikipedia.org/wiki/X_Windo..._core_protocol |
Good, but it still didn't help me understand what Mode_Switch and mod1-5 do.
|
Hmm, I just tried out something that used to work to give you an example but it no more does :-(
Looks like the X server and its clients have quite evolved since last time I checked ... |
I always get confused with Xmodmap and the man page is not much use (which is why I prefer to rewrite the driver files), but I think
Lock = caps lock Mod1 = alt (aka meta) Mod2 = number lock Mod4 = super (aka windows) Mod5 = level 3 shift (aka AltGr, Opt) Mod3 I can't remember :confused: The double naming can be confusing at first. "Caps_Lock" is the name of the key, as established by the keyboard driver, while "Lock" is the function it carries out. If you have a pc keyboard without AltGr, you must be in the USA: everywhere else, it's where you have your right Alt key. The desktop configuration system will enable that to be changed, and the Level 3 Shift can go on RAlt, LAlt, RWin, LWin, Menu, LWin+RWin, etc, etc. I have it where the CapsLock used to be :) |
Quote:
Quote:
Quote:
|
It's a bit difficult to advise you, because I'm not sure exactly what you are trying to do, or what facilities exist in your distro, and I've largely forgotten xmodmap. But here goes.
Using xmodmap, you can write a shell script which is run at log-in to reconfigure keys. At present Alt_R is linked to Mod1, so you have to clear that setting, and then re-link it to Mod5 to give an ISO type keyboard with AltGr key. Then you can assign the scan code for an alphanumeric key (found with xev) to its usual value and extras values for AltGr and AltGr+Shift. Look at the man page, and I think there's an explanation in this site's wiki. If you have a reasonable desktop or window manager, you should be able to set a third level shift using the keyboard configuration. Your keyboard is described by /usr/share/X11/xkb/symbols/us You can add an entry to create AltGr key <RALT> { [ ISO_Level3_Shift ] }; and add up to two extra symbols to any key as I have done in key <AC02> {[ s, S, Greek_sigma, Greek_SIGMA ]}; |
My goal would be for a key to be able to act as a modifier and a typing key at the same time. For example typing 'b' while holding down 'a' would type an unrelated character, but pressing and releasing 'a' would type an 'a'.
And I do not have any kind of DE or GUI that controls key mappings, and it is not necessary for this to be done using Xmodmap. |
All times are GMT -5. The time now is 11:38 PM. |