.Xmodmap and meta key
I use xmodmap to set my right alt key as a mode_switch key that allows me to type international characters. However, that means I don't have a meta key to use with emacs. What do I need to put in my .Xmodmap file to set my right control key to whatever emacs sees as the meta key (keeping my left control as is)?
|
Code:
keycode # = Control_L |
Isn't that setting some key to be control, not meta?
|
Yes, but would emacs see a difference? It is the default value of what your emacs currently sees, I don't know if it will work but it is worth a try.
Edit: Nevermind me, I'm just a little slow today. Code:
xmodmap -e "keysym Control_R = Control_R Meta_L" Code:
% cat ~/.Xmodmap |
Hmm, it gives errors when I try the lines above, but I looked through the documentation some more and tried something else. It looks like the key code for Control_R is 97. I put the following in .Xmodmap:
Code:
keycode 97 = Meta_L |
Well, you got me very interested in this problem, as a result, I installed emacs and I believe I have your solution.
Code:
xmodmap -e "remove control = Control_R" Code:
Option "RightCtl" "Meta" Edit: I just realized you might have set Control_R to Meta_L, in which case, just switch it back to Control_R with Code:
xmodmap -e "keycode 97 = Control_R" |
You're welcome, and I'm inviting you to learn more :)
That solution accomplished more than I'd done before, but still doesn't quite work. The problem is, I have Fluxbox set up to have mod1 be the modifier used in most key bindings. If I make your changes and then do Ctrl-t, it is interpreted as what I normally do as Alt-t (also bound to mod1), which opens a terminal window. The way I understood it from poking around online, emacs just needs a key to be designated Meta without having any modifier bindings to work, but it doesn't seem to for me. |
Well, you could put the left alt key in mod3 (it is empty in my xmodmap) and replace all mod1's in your Fluxbox configuration with mod3, that shouldn't change any functionality, just how it works under the hood, it's a patch job; I haven't given up :) I will see what I can come up with.
Edit: However, you may like this solution better...I hope it doesn't bugger anything else, Emacs, when it came about, as you've probably read, heavily used meta-keys, some keyboards didn't have them, so the author added the ability to use the Escape key...so Code:
xmodmap -e "remove mod1 = Control_R" |
The problem with the escape solution is that, when using that method, you press and release escape, then press the key, rather than the normal method of doing keystrokes. I'll try rearranging all the modifiers though and see if that does the trick.
|
I knew it couldn't be that simple :( However, the binding of Control_R to Escape does seem to work as a Keystroke pressing Control_R and A returns me to the first line of the working paragraph; this is as far as my Emacs knowledge goes, do you have a specific keystroke that you are using that gives you faulty behavior?
|
I moved all the modifiers around and Control_R now acts as escape. If I just press Control_R, "ESC-" appears at the bottom of the screen. I've been trying C-v and M-v, but M-v won't work unless I release Control_R before pressing v (that is, it's acting as escape, not meta).
|
So as mod3 it is Escape or did you leave it as
Code:
xmodmap -e "keysym Control_R = Escape" Code:
xmodmap -e "keycode 97 = Control_R" |
All times are GMT -5. The time now is 09:26 PM. |