all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to distinguish character from noncharacter input events?
Date: Wed, 11 Aug 2004 21:24:09 +0300	[thread overview]
Message-ID: <200408111824.i7BIO908022798@beta.mvs.co.il> (raw)
In-Reply-To: <bjj8ycmgxus.fsf@aquifer1.fi.uib.no> (message from Joakim Hove on Wed, 11 Aug 2004 05:25:15 +0200)

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	other threads:[~2004-08-11 18:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-10 14:03 How to distinguish character from noncharacter input events? Joe Fineman
2004-08-10 15:32 ` Stefan Monnier
2004-08-11 22:09   ` Joe Fineman
2004-08-11 23:53     ` Kevin Rodgers
2004-08-12 12:05     ` Kai Grossjohann
2004-08-11  3:25 ` Joakim Hove
2004-08-11 18:24   ` Ehud Karni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200408111824.i7BIO908022798@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.