help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Translating keys


From: Pascal Bourguignon
Subject: Re: Translating keys
Date: Mon, 17 Oct 2005 04:10:24 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Elena Garrulo <egarrulo@muchomail.com> writes:

> Hello,
>
>       I'd like to translate some keys in a mode dependent way. For
> example, when in c-mode, the key which prints "ò" should print "{";
> when in text-mode should print the original character. Since the
> translation should be mode dependent, keyboard-translate is not a
> viable option. I've tried:
>
> (local-set-key "ò" (lambda () (interactive) (insert "{")))

If you want to translate keys why do you use local-set-key? 
Use: keyboard-translate !

Now, if what you really want is to bind a function to a key, then use
local-set-key: (local-set-key (kbd "A-o") ...)  or whatever key
combination you use to get 'ò'.

A- = Alt
C- = Control
M- = Meta
S- = Shift
s- = Super
H- = Hyper

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush


reply via email to

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