On Thu, Dec 12, 2013 at 7:49 PM, Jeremy Huddleston Sequoia
<email@hidden> wrote:
On Dec 12, 2013, at 14:33, Yang Zhang <email@hidden> wrote:
I just installed XQuartz on Mountain Lion, but I can't get the alt
(option) key to be the meta key, an important modified key for a whole
host of X-based applications.
The command key is meta.
Dah, I should have mentioned that I also tried Command a bunch, but
I've always only ever seen it simply insert literal characters (e.g.
cmd-b inserts b). Except for some special shortcuts such as cmd-tab
(switch windows), cmd-space (Spotlight), and, depending on "Enable key
equivalents under X11," cmd-, cmd-`, etc.
I tried disabling "Enable key equivalents under X11" but that doesn't
seem to affect anything.
It affects you being able to use OSX key equivalents or send them to X11 (cmd-`, etc).
The only thing I could do to affect anything
was enabling "Option keys send Alt_L and Alt_R," but Meta doesn't kick
in—e.g. alt-b just types a literal 'b'.
That changes option between Alt and Mode_shift.
I think part of the problem is that these are somewhat obtuse terms to
me (and I imagine most users)—would you happen to have a pointer to a
(preferably concise) reference on what these mean? They're also a bit
tricky to Google for.
The way I'm testing this is just by running xterm and pressing alt-b
and alt-f to make sure the cursor is jumping forward/backward by a
word (expecting same behavior as esc-then-b or esc-then-f).
try 'xinput test keyboard' or 'xev'
I've been doing a bunch of Googling on this but (surprisingly) haven't
found anything promising, mostly about random folks' problems with
their own personal xmodmaps.
I tried:
http://xquartz.macosforge.org/trac/wiki/KeyboardMapping
What do you mean you tried that?
I tried putting this into a file `.xmodmap` and running `xmodmap .xmodmap`:
keycode 66 = Alt_L
keycode 69 = Alt_R
clear mod1
add mod1 = Alt_L Alt_R
But that behaves simliarly to "Option keys send Alt_L and Alt_R"—I
just get the literal keys, and still no meta functionality.
Did you load the map?
If by that you mean whether I ran `xmodmap` on the file, then yeah.
(I also tried this:
http://stackoverflow.com/questions/14379566/change-meta-to-option-key-when-using-xquartz-on-mac-to-open-emacs-installed-on-r
but then I get:
$ cat ~/.xmodmap
You want to save it to ~/.Xmodmap, not ~/.xmodmap.
clear Mod1
keycode 63=Control_L
keycode 71=Control_R
keycode 66=Meta_L
keycode 69=Meta_R
add Mod1 = Meta_L Meta_R
add Control = Control_L Control_R
Why are you trying to change control?
Because that's the solution suggested above post. I noted that
Control seemed to be the only differentiator. At this point,
everything I'm doing might as well be black magic, hence I gave it a
go anyway, despite my guess that it wouldn't solve the problem.
$ xmodmap ~/.xmodmap
X Error of failed request: BadValue (integer parameter out of range
for operation)
Major opcode of failed request: 118 (X_SetModifierMapping)
Value in failed request: 0x17
Serial number of failed request: 16
Current serial number in output stream: 16
Yeah, that's from "add Control = Control_L Control_R"
And, unlike for the OP, it doesn't change anything for me when I start
a new xterm. But it seems to be due to Control—when I remove those
lines, the config file is basically the same as the prior one.)
Yeah, because of the reported error (and incorrect filename).
I try running xev and I can confirm that when I press the alt key I
see keycode 66 (Meta_L), which is consistent with the xmodmaps. So I
don't know what's going on.
Any help would be greatly appreciated. Thanks!
If you really want both option and command to be meta, you can do this:
$ cat > ~/.Xmodmap
clear mod1
clear mod2
keycode 66=Meta_L
keycode 69=Meta_R
add mod1 Meta_L Meta_R
Note that Command's Meta_L and Meta_R are already in mod2, so that is why I clear it and mod1 (which contain Mode_switch/Option) and add all of them to mod1.
Thus you'll now have one modifier key to which all four (left opt, right opt, left command, right command) are mapped as meta. I'm not sure why you'd want to do that, but there you go:
I'd actually be happy with Command as well, but that was not working
any more than Alt.
Your suggestion doesn't seem to work either. I assume you meant:
clear mod1
clear mod2
keycode 66=Meta_L
keycode 69=Meta_R
add mod1 = Meta_L Meta_R
Alt still does not behave as Meta, and Command starts producing
strange characters (e.g. cmd-b simply switches from producing a
literal 'b' to an accented character â). However, the xmodmap lines
up with yours.
$ xmodmap
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44)
lock Caps_Lock (0x41)
control Control_L (0x43), Control_R (0x46)
mod1 Meta_L (0x3f), Meta_L (0x42), Meta_R (0x45), Meta_R (0x47)
mod2
mod3
mod4
mod5
$ xmodmap
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44)
lock Caps_Lock (0x41)
control Control_L (0x43), Control_R (0x46)
mod1 Meta_L (0x3f), Meta_L (0x42), Meta_R (0x45), Meta_R (0x47)
mod2
mod3
mod4
mod5
--Jeremy
Any other ideas? Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden