From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.help Subject: Re: How to distinguish character from noncharacter input events? Date: Wed, 11 Aug 2004 21:24:09 +0300 Organization: Mivtach-Simon Insurance agencies Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200408111824.i7BIO908022798@beta.mvs.co.il> References: Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8-i Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1092248712 12666 80.91.224.253 (11 Aug 2004 18:25:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Aug 2004 18:25:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 11 20:24:46 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BuxmH-0004TI-00 for ; Wed, 11 Aug 2004 20:24:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Buxq8-0007xp-Oo for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Aug 2004 14:28:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Buxpz-0007xg-9I for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 14:28:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Buxpx-0007x1-9p for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 14:28:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Buxpx-0007wy-2f for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 14:28:33 -0400 Original-Received: from [193.16.147.12] (helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Buxln-0003Kv-RC for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 14:24:16 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.13.0/8.13.0) with ESMTP id i7BIOAuL024785 for ; Wed, 11 Aug 2004 21:24:10 +0300 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.10/8.12.10) with ESMTP id i7BIOAqi022801 for ; Wed, 11 Aug 2004 21:24:10 +0300 Original-Received: (from root@localhost) by beta.mvs.co.il (8.12.10/8.12.10/Submit) id i7BIO908022798; Wed, 11 Aug 2004 21:24:09 +0300 Original-To: "Joe Fineman" , " Joakim Hove" In-reply-to: (message from Joakim Hove on Wed, 11 Aug 2004 05:25:15 +0200) X-Mailer: Emacs 21.3.1 rmail (send-msg 1.108) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20082 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20082 On Wed, 11 Aug 2004 05:25:15 +0200, Joakim Hove wrote: > > Joe Fineman 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 Better Safe Than Sorry