Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Alt vs Meta - Sun keyboard, redhat linux

205 views
Skip to first unread message

chengiz

unread,
Dec 31, 2010, 6:21:24 PM12/31/10
to
Hi,

I use a Sun Type 6 keyboard on a Redhat machine running Gnome. Here,
by default in gnu emacs, the Alt key mapped to M- and the Meta key was
unmapped.

I want like on my older sun machine, to use the Meta key as M- and Alt
key as A-.

In gnome-keyboard-properties, under Layout Options -> Alt/Win key
behaviour, I set "Meta is mapped to the Win-keys". This resulted in
the Meta key being mapped to M- but the Alt key is still mapped to M-.
How do I map the Alt key to A-?

Thank you.

Peter Dyballa

unread,
Jan 1, 2011, 2:35:53 PM1/1/11
to chengiz, help-gn...@gnu.org

Am 01.01.2011 um 00:21 schrieb chengiz:

> In gnome-keyboard-properties, under Layout Options -> Alt/Win key
> behaviour, I set "Meta is mapped to the Win-keys". This resulted in
> the Meta key being mapped to M- but the Alt key is still mapped to M-.
> How do I map the Alt key to A-?

I'm not using GNOME.

I'd use xmodmap to change the modifier keys. And I'd use xev to
determine the key code or symbol name of the keys to change.

In ~/.xinitrc you then can have:

xmodmap ${HOME}/.xmodmaprc

and .xmodmaprc can have a little "programme" like this:

clear Mod1
clear Mod2
add Mod1 = Alt_L Alt_R
add Mod2 = Meta_L Meta_R

--
Greetings

Pete

It isn't pollution that's harming the environment. It's the impurities
in our air and water that are doing it.


chengiz

unread,
Jan 3, 2011, 3:25:44 PM1/3/11
to

Which of these "Mod?"s does emacs use for its Alt modifier? My current
xmodmap already has Alt_L at Mod1. I want emacs to treat this like
Emacs-alt (ie. the rarely used Alt modifier mentioned at
http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Keyboard.html)
rather than Emacs-meta.

Peter Dyballa

unread,
Jan 3, 2011, 5:53:39 PM1/3/11
to chengiz, help-gn...@gnu.org

Am 03.01.2011 um 21:25 schrieb chengiz:

> Which of these "Mod?"s does emacs use for its Alt modifier? My current
> xmodmap already has Alt_L at Mod1. I want emacs to treat this like
> Emacs-alt (ie. the rarely used Alt modifier mentioned at
> http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Keyboard.html)
> rather than Emacs-meta.

Why do you think the Alt and Meta key modifiers have something to do
with MS Losedos?

The Meta modifier is the M in, for example, M-x. M-ESC is ESC-ESC. The
Meta modifier is accepted by GNU Emacs as the "Meta" modifier.

The Alt modifier can select up to two (two, because with and without
Shift pressed) character keyboard layouts. On my keyboard, for
example, Alt-a produces å and Alt-S-a Å. The Alt modifier is accepted
by GNU Emacs as the "Alt" modifier.

If you want to find out what some "Alt" named key on your keyboard
produces, then use xev (best launched from a *shell* buffer in GNU
Emacs), give it the focus and press that key. Xev will produce some
cryptic output that can be deciphered to some meaning. Similarly
proceed with the "Meta" titled key on your keyboard. With the
information of the key codes these keys generate when pressed or
released, you can reset "key bindings" in X11:

keycode <whichever> = Alt_R
keycode <whatever> = Meta_L

Actually my first example was incomplete, because changing the
sequence of modifiers does not change their meaning because the keys
have also a keysym by which they are understood.

When you write that you have the Alt_L modifier already defined, then
find out which key produces this modifier event. Xev can be your
friend. Once you've located the Alt_L key on your keyboard, you can
use it in GNU Emacs. The xkeycaps utility might be able to have your
keyboard layout loaded. Then you'll see graphically what you press.

--
Greetings

Pete

Ce qui été compris n'existe plus.
(Paul Eluard)


chengiz

unread,
Jan 4, 2011, 12:12:25 PM1/4/11
to
On Jan 3, 5:53 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Why do you think the Alt and Meta key modifiers have something to do  
> with MS Losedos?

Where do I think that?


> If you want to find out what some "Alt" named key on your keyboard  
> produces, then use xev (best launched from a *shell* buffer in GNU  
> Emacs), give it the focus and press that key. Xev will produce some  
> cryptic output that can be deciphered to some meaning. Similarly  
> proceed with the "Meta" titled key on your keyboard. With the  
> information of the key codes these keys generate when pressed or  
> released, you can reset "key bindings" in X11:
>
>         keycode <whichever> = Alt_R
>         keycode <whatever> = Meta_L
>

I used xev to verify that the Alt-key produces Alt_L and the 2 meta-
keys produce Meta_L and Meta_R. Emacs treats the meta-keys as if they
produced M- which is what I want, however it also treats the Alt-key
as if produced M-, which is what I want to change to A-. I think the
missing piece is what emacs is doing with Alt_L, as in why it is not
processing it as A-.
Here's my xmodmap output:
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x6d)
mod1 Alt_L (0x40), Alt_R (0x71), Alt_L (0x7d)
mod2 Num_Lock (0x4d)
mod3
mod4 Meta_L (0x73), Meta_R (0x74), Super_L (0x7f), Hyper_L
(0x80), Meta_L (0x9c)
mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c)
I cant tell what to put in my xmodmaprc to make sure emacs behaves
correctly.

Thanks,
chengiz

Peter Dyballa

unread,
Jan 4, 2011, 5:47:59 PM1/4/11
to chengiz, help-gn...@gnu.org

Am 04.01.2011 um 18:12 schrieb chengiz:

> On Jan 3, 5:53 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
>> Why do you think the Alt and Meta key modifiers have something to do
>> with MS Losedos?
>
> Where do I think that?

Because you inserted the link to some "Windows-Keyboard".

> I think the missing piece is what emacs is doing with Alt_L, as in
> why it is not processing it as A-.
> Here's my xmodmap output:
> shift Shift_L (0x32), Shift_R (0x3e)
> lock Caps_Lock (0x42)
> control Control_L (0x25), Control_R (0x6d)
> mod1 Alt_L (0x40), Alt_R (0x71), Alt_L (0x7d)
> mod2 Num_Lock (0x4d)
> mod3
> mod4 Meta_L (0x73), Meta_R (0x74), Super_L (0x7f), Hyper_L
> (0x80), Meta_L (0x9c)
> mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x7c)
> I cant tell what to put in my xmodmaprc to make sure emacs behaves
> correctly.


Modifier 5 cannot be Meta, Super, and Hyper altogether.

When you launch GNU Emacs with -Q, without any customisation, does it
still interpret Alt as Meta? If so, then my assumption about the
parity of the modifiers is wrong and it plays a role that mod1 is Meta
and mod2 or mod3 is Alt. Then Hyper and maybe Super can follow, but I
think Mode_switch is more important, since it's the compose key, which
allows to type ø as o / etc. Num_Lock can be pretty useless.

In case Alt and Meta work correctly in 'emacs -Q', then something in
your or your system's customisation (init files) is exchanging them.

--
Greetings

Pete

When people run around and around in circles we say they are crazy.
When planets do it we say they are orbiting.


chengiz

unread,
Jan 4, 2011, 6:17:13 PM1/4/11
to

There is no difference with -Q, it still interprets Alt as Meta.

Peter Dyballa

unread,
Jan 4, 2011, 7:24:35 PM1/4/11
to chengiz, help-gn...@gnu.org

Am 05.01.2011 um 00:17 schrieb chengiz:

> There is no difference with -Q, it still interprets Alt as Meta.

Are you going to change the sequence of the modifier definitions? (You
don't need to restart GNU Emacs, it will receive the new changed key
events.)

Mine is sparse:

shift Shift_L (0x40), Shift_R (0x44)
lock Caps_Lock (0x41)
control Control_L (0x43), Control_R (0x46)
mod1
mod2 Meta_L (0x3f), Meta_R (0x47)
mod3
mod4
mod5

...not a desktop computer!

--
Greetings

Pete

To drink without thirst and to make love all the time, madam, it is
only these which distinguish us from the other beasts.
– Beaumarchais


0 new messages