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

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

Re: [h-e-w] can NTEmacs (20 or 21) completely ignore Alt key?


From: Jonathan Epstein
Subject: Re: [h-e-w] can NTEmacs (20 or 21) completely ignore Alt key?
Date: Tue, 06 Nov 2001 10:03:13 -0500

Right, I somehow thought that Emacs wasn't seeing any of these characters fly 
by at all.  This was a total misconception on my part.

Here's the workaround, for posterity.

-Jonathan

(global-set-key [M-kp-0] (lambda (arg) (interactive "p") (handle-kp 0)))
(global-set-key [M-kp-1] (lambda (arg) (interactive "p") (handle-kp 1)))
(global-set-key [M-kp-2] (lambda (arg) (interactive "p") (handle-kp 2)))
(global-set-key [M-kp-3] (lambda (arg) (interactive "p") (handle-kp 3)))
(global-set-key [M-kp-4] (lambda (arg) (interactive "p") (handle-kp 4)))
(global-set-key [M-kp-5] (lambda (arg) (interactive "p") (handle-kp 5)))
(global-set-key [M-kp-6] (lambda (arg) (interactive "p") (handle-kp 6)))
(global-set-key [M-kp-7] (lambda (arg) (interactive "p") (handle-kp 7)))
(global-set-key [M-kp-8] (lambda (arg) (interactive "p") (handle-kp 8)))
(global-set-key [M-kp-9] (lambda (arg) (interactive "p") (handle-kp 9)))
(global-set-key [A-kp-0] (lambda (arg) (interactive "p") (handle-kp 0)))
(global-set-key [A-kp-1] (lambda (arg) (interactive "p") (handle-kp 1)))
(global-set-key [A-kp-2] (lambda (arg) (interactive "p") (handle-kp 2)))
(global-set-key [A-kp-3] (lambda (arg) (interactive "p") (handle-kp 3)))
(global-set-key [A-kp-4] (lambda (arg) (interactive "p") (handle-kp 4)))
(global-set-key [A-kp-5] (lambda (arg) (interactive "p") (handle-kp 5)))
(global-set-key [A-kp-6] (lambda (arg) (interactive "p") (handle-kp 6)))
(global-set-key [A-kp-7] (lambda (arg) (interactive "p") (handle-kp 7)))
(global-set-key [A-kp-8] (lambda (arg) (interactive "p") (handle-kp 8)))
(global-set-key [A-kp-9] (lambda (arg) (interactive "p") (handle-kp 9)))

(setq kp-tally 0)
(setq kp-count 0)

(defun handle-kp (num)
   "handle keypad numbers for DNS 5"
   (interactive "p")
   (setq kp-tally (+ (* kp-tally 10) num))
   (setq kp-count (+ 1 kp-count))
   (if (> kp-count 3)
       (progn
         (insert kp-tally)
         (setq kp-tally 0)
         (setq kp-count 0)))
   )

At 04:12 PM 11/5/2001 , Stephen Leake wrote:
>Jonathan Epstein <address@hidden> writes:
>
> > <snip>
> > Thanks for your response, Jason.  The requirements are that no
> > additional keystrokes such as Cntl-Q can be issued.  Emacs must be
> > able to detect the pressing and holding of the Alt-Key, the numeric
> > keyboard's 0034 keys, and the release of the Alt-Key.
>
>What is it you _want_ to have happen, when you type M-0034?
>
>Why is it you can't just type "?
>
>I guess Dragon Naturally Speaking will also monitor the key events,
>and pronounce the character? 
>
>Do you want Emacs to then insert the corresponding character into the
>current buffer?
>
> > I don't know how to detect these events, but would appreciate input
> > from anyone who does.
>
>Just doing some testing, on my keyboard (Windows NT 4.0 SP3,
>English/US), when I hit M-kp-0, Emacs says "M-kp-0 is undefined". If
>you want to define the sequence M-kp-0 M-kp-0 M-kp-3 M-kp-4 to mean
>"insert double-quote", that's pretty easy.
>
> > Clarifications: I'm running W2K service pack 1.  Unfortunately, it
> > appears that the left-alt key is being using by NaturallySpeaking ...
>
>Do you mean Emacs does not see the left-alt key? 
>
>-- 
>-- Stephe




reply via email to

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