From: harven <harven@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: Capture ALL keystrokes
Date: Fri, 30 May 2008 02:57:48 -0700 (PDT) [thread overview]
Message-ID: <2dccffc3-e20a-4d28-86f6-4932c175073b@t54g2000hsg.googlegroups.com> (raw)
In-Reply-To: mailman.12372.1212057381.18990.help-gnu-emacs@gnu.org
On May 29, 12:36 pm, "Ben Forbes" <bdfor...@gmail.com> wrote:
> 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?
Be more specific about what you are trying to achieve.
Bound the following command to key A. Pressing the A key
inserts the letter A. It then executes the command newline
repeatedly if B is pressed any amount of time.
(defun my-command ()
"After key A, key B executes the command newline repeatedly"
(interactive)
(insert "A")
(while (equal (setq key (read-event)) ?B)
(next-line))
(push key unread-command-events))
(global-set-key "A" 'my-command)
next parent reply other threads:[~2008-05-30 9:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.12372.1212057381.18990.help-gnu-emacs@gnu.org>
2008-05-30 9:57 ` harven [this message]
2008-05-30 11:21 ` Capture ALL keystrokes Ben Forbes
2008-05-29 10:36 Ben Forbes
2008-05-29 11:11 ` Daniel Pittman
2008-05-29 12:01 ` Ben Forbes
2008-05-29 13:32 ` Lennart Borgman (gmail)
2008-05-29 15:10 ` Tassilo Horn
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2dccffc3-e20a-4d28-86f6-4932c175073b@t54g2000hsg.googlegroups.com \
--to=harven@free.fr \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).