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

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

Re: How to distinguish character from noncharacter input events?


From: Ehud Karni
Subject: Re: How to distinguish character from noncharacter input events?
Date: Wed, 11 Aug 2004 21:24:09 +0300

On Wed, 11 Aug 2004 05:25:15 +0200, Joakim Hove <hove@ift.uib.no> wrote:
>
> Joe Fineman <jcf@TheWorld.com> writes:
>
> > Is there a function that distinguishes character from noncharacter
> > input events?  It would be nice to be able to write
> >
> > (let ((next (read-event)))
> >   (if (char-p next)
> >       (progn ...)
> >     (...)))

You can use other predicates to distinguish, something like this:

(defun test-event ()
  (interactive)
  (let ((next (read-event "Enter event")))
  ;;   (describe-variable 'next)           ;; for debug
       (if (listp next)
           (message "Real event (mouse)")
           (if (numberp next)
               (message "Real char read")
               (message "Key press (non char) read")))))

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry




reply via email to

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