[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange characters produced by M-x in emacs -nw

From: Pascal J. Bourguignon
Subject: Re: Strange characters produced by M-x in emacs -nw
Date: Sat, 21 Sep 2013 18:14:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Harry Putnam <address@hidden> writes:

> "Pascal J. Bourguignon" <address@hidden> writes:
>> Harry Putnam <address@hidden> writes:
>>> "Pascal J. Bourguignon" <address@hidden> writes:
>>>> Stefan Monnier <address@hidden> writes:
>>>>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>>>>> This might be a source of problems: try to remap your Meta_L key to
>>>>> Alt_L as follows:
>>>>>   xmodmap -e 'keysym Meta_L = Alt_L'
>>>> No, instead map Meta_L to a free keycode!
>>>> Don't confuse Alt and Meta Combine them!
>>>> Bind A-M-x and others to some useful command!
>>> What about some examples?
>> Yes, I'm posting my .xmodmap each week…
>> !
>> ! This is an `xmodmap' input file for the  DasKeyboard 3
>> !
>> ! Bus 008 Device 005: ID 04d9:2013 Holtek Semiconductor, Inc. 
>> !
>> ! PC 105 keys, wide Delete, wide Enter.
>> !
> Don't mean to sound like an ingrate but that is just plain over my
> head. 
> What part of that makes the switch you spoke of? Can it be done with
> a simple 1-2 line xmodmap command.

Mostly. But since there's a finite number of keys on a keyboard in
general, rebinding a key has consequences and you may want to shift the
old function on a new key etc.

Also, the keycode while often similar from one keyboard to the other,
are often different notably on the modifier keys.

So you will have to use xev(1), to find out the keycodes of the keys you
want to bind to the symbols, then map them to symbols:

keycode  37 = Multi_key       
keycode 133 = Alt_L
keycode  64 = Meta_L

keycode  65 = space         space       digitspace          digitspace

keycode 108 = Meta_R
keycode 134 = Mode_switch
keycode 135 = Hyper_R
keycode 105 = Control_R

! It's on the Print/Sys_Req key:
keycode 127 = Super_R         Super_R

then you must map the symbols of the modifier keys to the modifier byte:

clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5

!!! In order of bits: 
add    Shift   = Shift_L     Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L   Control_R
add    Mod1    = Num_Lock
add    Mod2    = Alt_L       Alt_R       Mode_switch
add    Mod3    = Meta_L      Meta_R
add    Mod4    = Super_L     Super_R
add    Mod5    = Hyper_L     Hyper_R     

and that's it. Notice how alt and meta are different modifiers.

__Pascal Bourguignon__

reply via email to

[Prev in Thread] Current Thread [Next in Thread]