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

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

Re: Emacs23 on a Mac, how to get keypad to send kp-4, etc.?


From: Michael Heerdegen
Subject: Re: Emacs23 on a Mac, how to get keypad to send kp-4, etc.?
Date: Fri, 08 Jul 2011 22:38:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi,

in my Emacs 23.3 (on Debian), the kp keys are bound in simple.el, in
this expression:

(mapc
 (lambda (keypad-normal)
   (let ((keypad (nth 0 keypad-normal))
         (normal (nth 1 keypad-normal)))
     (put keypad 'ascii-character normal)
     (define-key function-key-map (vector keypad) (vector normal))))
 '((kp-0 ?0) (kp-1 ?1) (kp-2 ?2) (kp-3 ?3) (kp-4 ?4)
   (kp-5 ?5) (kp-6 ?6) (kp-7 ?7) (kp-8 ?8) (kp-9 ?9)
   (kp-space ?\s)
   (kp-tab ?\t)
   (kp-enter ?\r)
   (kp-multiply ?*)
   (kp-add ?+)
   (kp-separator ?,)
   (kp-subtract ?-)
   (kp-decimal ?.)
   (kp-divide ?/)
   (kp-equal ?=)
   ;; Do the same for various keys that are represented as symbols under
   ;; GUIs but naturally correspond to characters.
   (backspace 127)
   (delete 127)
   (tab ?\t)
   (linefeed ?\n)
   (clear ?\C-l)
   (return ?\C-m)
   (escape ?\e)))

This is done by default.  But you can just unbind them, like this:

(mapc
 (lambda (key)
   (define-key function-key-map (vector key) nil))
 '((kp-0) (kp-1) (kp-2) (kp-3) (kp-4)
   (kp-5) (kp-6) (kp-7) (kp-8) (kp-9)))

You can also add kp-space etc. to the list.

Does that what you want?


Best,

Michael.



reply via email to

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