Re: Meta key not working
Re: Meta key not working
- Subject: Re: Meta key not working
- From: Yang Zhang <email@hidden>
- Date: Fri, 13 Dec 2013 00:42:06 -0800
On Thu, Dec 12, 2013 at 11:48 PM, Jeremy Huddleston Sequoia
<email@hidden> wrote:
>
> On Dec 12, 2013, at 23:04, Yang Zhang <email@hidden> wrote:
>
>>>> 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.
>
> X11 documentation is probably your best bet. Look at http://www.x.org
>
>>> 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.
>
> Try from scratch (delete ~/.Xmodmap and relaunch). The command key is meta by default:
>
> ~ $ xmodmap
> xmodmap: up to 2 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 Mode_switch (0x42), Mode_switch (0x45)
> mod2 Meta_L (0x3f), Meta_R (0x47)
> mod3
> mod4
> mod5
Yep, after reset/relaunch, mine looks identical:
$ xmodmap
xmodmap: up to 2 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 Mode_switch (0x42), Mode_switch (0x45)
mod2 Meta_L (0x3f), Meta_R (0x47)
mod3
mod4
mod5
>
>> 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
>
> Yes, sorry I missed the = on the last line above.
>
>> 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
>
> What makes you think that it's not behaving as meta? The output above suggests otherwise. Run 'xev' and press the keys in the window, and you'll see they're meta, eg:
Hmm...not sure how else to describe it. I mean, Meta-b is just
outputting a display character. It's not behaving as any Meta that
I've seen when directly using X on Linux/Unix/BSD.
I mentioned one example of desired functionality: Meta-b should behave
as Esc-then-b in xterm (backward one word). Another example: many
Emacs commands rely on the Meta key, such as Meta-x. The particular
problem I'm interested in: getting shortcut keys to work in PyCharm,
so things like menus and shortcuts work.
>
> KeyRelease event, serial 34, synthetic NO, window 0x600001,
> root 0x171, subw 0x0, time 3941225288, (146,-8), root:(332,14),
> state 0x8, keycode 63 (keysym 0xffe7, Meta_L), same_screen YES,
> XLookupString gives 0 bytes:
> XFilterEvent returns: False
>
> --Jeremy
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden