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

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

Re: Capture ALL keystrokes


From: Lennart Borgman (gmail)
Subject: Re: Capture ALL keystrokes
Date: Thu, 29 May 2008 15:32:23 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Have a look at kmacro-call-macro which does something similar. It is bound to "C-x e" and you repeat it with just "e".

Ben Forbes wrote:
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 <daniel@rimspace.net> wrote:
"Ben Forbes" <bdforbes@gmail.com> 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











reply via email to

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