[Top][All Lists]

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

Re: Trouble binding Alt *by itself* to the execute-extended-command...(A

From: Pascal J. Bourguignon
Subject: Re: Trouble binding Alt *by itself* to the execute-extended-command...(Alt-x and ESC-x work fine.)
Date: Sun, 07 Jul 2013 14:49:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Bob Proulx <> writes:

> Chris Seberino wrote:
>> Alt-x invokes the execute-extended-command just fine.
>> I'd like the Alt key *by itself* to this command.
> That doesn't make any sense to me.  It would be like asking for making
> the shift key by itself produce a shift-A.  

Which is no problem, as I shown in my other answer!

Shift_L_keycode=$(xmodmap -pke|awk '/= Shift_L/{print $2}')
xmodmap -e "keycode $(Shift_L_keycode) = A A"

#to revert:
xmodmap -e "keycode $(Shift_L_keycode) = Shift_L" 

> Keys like shift and meta (alt on modern keyboards) and control aren't
> supposed to produce keys by themselves.  They are supposed to modify
> other keys pressed with them.

You are confused.  

There are keys on a keyboard that are supposed to be pressed.  When you
press a key, a keycode is supposed to be transmitted to the computer.
When a keycode is received, a keysym is supposed to be mapped from it by
X11, and sent to the application.  When emacs receives a keysym it is
supposed to map it to a command.  

Emacs doesn't see keys or key presses on the keyboard!

> If you did this then how would you type in M-a or M-e or any of the
> others without the meta (alt) key?

You could press on the ESC key or on the CONTROL key with the [ key
(assuming the default mapping of keycodes to keysyms and keysyms to
emacs commands).

__Pascal Bourguignon__           
A bad day in () is better than a good day in {}.  
You know you've been lisping too long when you see a recent picture of George 
Lucas and think "Wait, I thought John McCarthy was dead!" -- Dalek_Baldwin

reply via email to

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