From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ben Forbes" Newsgroups: gmane.emacs.help Subject: Re: Capture ALL keystrokes Date: Thu, 29 May 2008 22:01:48 +1000 Message-ID: <206a409a0805290501t5cdce3ffhb9b927e1b3d37267@mail.gmail.com> References: <206a409a0805290336m5b3ef264qab3bedca5f040e4b@mail.gmail.com> <87hcch74b2.fsf@rimspace.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1212062544 11804 80.91.229.12 (29 May 2008 12:02:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 May 2008 12:02:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Daniel Pittman" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 29 14:03:05 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K1gqN-0007QT-BQ for geh-help-gnu-emacs@m.gmane.org; Thu, 29 May 2008 14:02:55 +0200 Original-Received: from localhost ([127.0.0.1]:42583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1gpb-0004e3-VT for geh-help-gnu-emacs@m.gmane.org; Thu, 29 May 2008 08:02:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1gpL-0004ba-98 for help-gnu-emacs@gnu.org; Thu, 29 May 2008 08:01:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1gpK-0004au-BW for help-gnu-emacs@gnu.org; Thu, 29 May 2008 08:01:50 -0400 Original-Received: from [199.232.76.173] (port=49529 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1gpK-0004ar-8L for help-gnu-emacs@gnu.org; Thu, 29 May 2008 08:01:50 -0400 Original-Received: from yw-out-1718.google.com ([74.125.46.156]:63490) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K1gpJ-0003HP-Q4 for help-gnu-emacs@gnu.org; Thu, 29 May 2008 08:01:49 -0400 Original-Received: by yw-out-1718.google.com with SMTP id 9so1943017ywk.66 for ; Thu, 29 May 2008 05:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ENmVTY/paU41SCcz78ydDU+qMgweWZglcopl3Q2ClLw=; b=ip46vK/9AbrsSC6wAqHk4wb+igFsw2cNi0QQvRAcTaZeZxlYDwwiutgwc3UxNDns7YZQzKvi8kId9wjaoPaZRNpgKP57BPwkCfb837cu/AlrDLq1itXjW8gOTmH+jC+qAQSDW8km4XpgmnQRz5cnpie7VYNpP84RkiuTgtDt3hE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SRDStxxSqw+KkOf+jyhdEVq9U6eP4SrVCt7JXFSx7SldOxPLhTDEelyHIiyLIe9zSEFKBNXbO/PNcaKnXckmpCC9WrFrNYuagqFUqK82RFXE7CJXsu7Ov/TviUZBtZiRVW+tzc9LmjBxIHBWYDeA/kz+gnGq2oei/RVOSa5++Dg= Original-Received: by 10.151.42.13 with SMTP id u13mr202744ybj.137.1212062508803; Thu, 29 May 2008 05:01:48 -0700 (PDT) Original-Received: by 10.150.181.5 with HTTP; Thu, 29 May 2008 05:01:48 -0700 (PDT) In-Reply-To: <87hcch74b2.fsf@rimspace.net> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54359 Archived-At: Yes I thought my approach seemed too complex. I don't think your first suggestion will work, because I want to be able to hit AB, ABB, ABBB, ABBBB etc, where each repeated keystroke B repeats the command. Could you expand on the second option? It sounds promising, thanks. On Thu, May 29, 2008 at 9:11 PM, Daniel Pittman wrote: > "Ben Forbes" writes: > >> When some keystroke A is entered, I set a flag, and I want this flag >> to be unset if any keystroke is entered except some keystroke B. So >> basically, I only want keystroke B to have any effect if it is >> preceded by keystroke A. How can I do this? > > The standard way would be: > > (define-key global-map [(a)(b)] #'my-function) > > Alternately, make a keymap, point the `a' key to it, and then install > handlers into it. > > Your approach is, in essence, "doing it wrong." > > Regards, > Daniel > > > >