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

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

Re: How to change the keyboard mapping?


From: John Mastro
Subject: Re: How to change the keyboard mapping?
Date: Fri, 12 Aug 2016 17:02:00 -0700

Sharon Kimble <boudiccas@skimble.plus.com> wrote:
> How can I map my alpha-ENTER to be the same as my numerical-ENTER please?
>
> I'm using a 'standard usb keyboard' (that's what it says on the
> underside anyway) and I'm finding that when using emacs as normal I can
> only accept entries on my dropdown word-prompt (I type in 3-4 letters
> and it pops up a list of possible solutions) using the numerical-ENTER.
> Also if it shows a possible one-word solution for auto-complete by the
> grey letters to finish the word, I can only accept using the
> numerical-ENTER key again.

What package are you using for completion (i.e. the thing offering
candidates via the dropdown)? I suspect the best solution will involve
adding something to that package's mode map rather than remapping the
key at a lower level in Emacs.

If it's auto-complete, try this:

(with-eval-after-load 'auto-complete
  (define-key ac-completing-map [return] #'ac-complete))

I don't have a keyboard with that key handy to test it, so I'm not sure
it will help. The reason for the suggestion is that I noticed that
auto-complete only binds `ac-complete' to "\r" (aka RET), whereas
company binds both that and [return]. [return] is normally translated to
RET, but it's possible for them to have different bindings.

Out of curiosity I tried something like the below (which was my first
thought for how to translate the "normal" enter key to the one on the
numeric keypad) but the result is not good.

(define-key key-translation-map (kbd "RET") [kp-enter])

        John



reply via email to

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