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

Re: Emacs keybinding of Ctrl-[

On 2 Oct 1998, Andy Spiegl wrote:
> And there is no way to separate ESC and C-[ ?
> I mean, who uses C-[ to get an ESC??

Text terminals do. But there's a way around it - from the Emacs manual's
discussion of keybindings (which you may find interesting, btw): 

   <TAB>, <RET>, <BS>, <LFD>, <ESC> and <DEL> started out as names for
certain ASCII control characters, used so often that they have special
keys of their own.  Later, users found it convenient to distinguish in
Emacs between these keys and the "same" control characters typed with
the <CTRL> key.

   Emacs distinguishes these two kinds of input, when used with the X
Window System.  It treats the "special" keys as function keys named
`tab', `return', `backspace', `linefeed', `escape', and `delete'.
These function keys translate automatically into the corresponding
ASCII characters *if* they have no bindings of their own.  As a result,
neither users nor Lisp programs need to pay attention to the
distinction unless they care to.

   If you do not want to distinguish between (for example) <TAB> and
`C-i', make just one binding, for the ASCII character <TAB> (octal code
011).  If you do want to distinguish, make one binding for this ASCII
character, and another for the "function key" `tab'.

   With an ordinary ASCII terminal, there is no way to distinguish
between <TAB> and `C-i' (and likewise for other such pairs), because
the terminal sends the same character in both cases.

> Can I use xmodmap to get udiaresis etc. with Hyper-[ ?  That way
> I wouldn't even have to bother with setting up emacs and would
> have the keys in all applications.  I tried:
>  keycode 0x1C  = Hyper_L
>  add     Mod4  = Hyper_L
>  keycode 0x56  = bracketleft braceleft udiaeresis Udiaeresis
> But that didn't work. :-(

Xmodmap is cryptic. I've had good luck with Xkeycaps, since it's otherwise
impossible to remember the syntax. 

I'm sure someone else can give you a quick formula. Another poster had a
better suggestion - apparently Emacs already has an international mode. 
I'd suggest reading about that in the Emacs manual and the Xmodmap man
page, and thinking about your options (Xkeycaps will let you look at
foreign keymappings, too, I think - so you could copy from that). 
There are probably three or four ways to do this.


Reply to: