all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: How to distinguish character from noncharacter input events?
Date: Tue, 10 Aug 2004 15:32:05 GMT	[thread overview]
Message-ID: <jwvllgnau93.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: wkllgn5bv7.fsf@TheWorld.com

> 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 ...)
>     (...)))

> but I can't find anything of the sort.

What for?
What's your definition of a "character event"?

You could try

   (integerp event)

but it will also return non-nil for M-p and C-x.  So you might want to use

   (and (integerp event) (null (event-modifiers event))

but it all depends on what you consider to be a character event, of course.


        Stefan

  reply	other threads:[~2004-08-10 15:32 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 [this message]
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

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=jwvllgnau93.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    /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.