From: "Ben Forbes" <bdforbes@gmail.com>
To: harven <harven@free.fr>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Capture ALL keystrokes
Date: Fri, 30 May 2008 21:21:01 +1000 [thread overview]
Message-ID: <206a409a0805300421g4079f40ai66ad3d793690b300@mail.gmail.com> (raw)
In-Reply-To: <2dccffc3-e20a-4d28-86f6-4932c175073b@t54g2000hsg.googlegroups.com>
> (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)
>
That approach works quite well, thanks. My goal was to be able to call
emms-random with a single keystroke when the initial call required two
keystrokes. This is because I've put all my emms keystrokes after
C-H-s-c to keep them organized. Now I can hit C-H-s-c C-H-s-r to call
emms-random once, and every time I hit C-H-s-r after that, it calls
emms-random again. It's a bit frivolous I guess, but it was more about
learning emacs programming than anything else. Thanks for the help
everyone.
next prev parent reply other threads:[~2008-05-30 11:21 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 ` Capture ALL keystrokes harven
2008-05-30 11:21 ` Ben Forbes [this message]
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=206a409a0805300421g4079f40ai66ad3d793690b300@mail.gmail.com \
--to=bdforbes@gmail.com \
--cc=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).