[Top][All Lists]

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

Re: remapping keys

From: Stefan Monnier
Subject: Re: remapping keys
Date: Wed, 20 Feb 2008 14:53:26 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>> Hi.  I'm an Emacs newbie  and I need help about remapping keyboard keys.
>>> I would like to bind the curly brackets "}" and "{" to another keys, handier
>>> to me (I have an italian keyboard, so the key sequence for the brackets is
>>> quite clumsy...)
>>> What's the procedure for doing so ?
>> It all depends on how you want the remapping to behave.  Do you want
>> this remapping only within Emacs?

> Yes.

>> Do you want it to apply to things
>> like C-{ and M-}?  How about C-x { ?
> Yes, why not ?

Because that's more difficult (unless you answered "no" to the previous
question, in which case it's easier instead).

You could try

  (define-key key-translation-map "{" "f")
  (define-key key-translation-map "}" "g")

and if you want to use "f" and "g" for { and }, then add

  (define-key key-translation-map "f" "{")
  (define-key key-translation-map "g" "}")

Note that it will apply to C-x { but not to C-{ and M-{, C-f, C-g, tho
it will apply to ESC { and ESC g.  I.e. it's kind of messy.

>> I personally prefer to do those kinds of "inconvenient keyboard" things
>> globally by choosing another keyboard layout (e.g. with
>> gnome-keyboard-properties).

> I would prefer a more selective approach, remapping only the keys I need.

Define your own keyboard layout?


reply via email to

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