all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Magnar Sveen <magnar@kodemaker.no>
To: Ivanov Dmitry <usr345@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs attach an action to any key pressed
Date: Wed, 5 Jun 2013 08:44:22 +0200	[thread overview]
Message-ID: <CALVcYyCNzkEoF+QP5jzXGFSqVUyuFdvr5sF5bHUG-vf=339zGg@mail.gmail.com> (raw)
In-Reply-To: <CAHyAE11Sqg6Q-yn0iuqjOpFG-7R_6cxynV=02uL7MaBcyVzs-w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

Sounds like you're looking for the post-command-hook.

- Magnar


On Wed, Jun 5, 2013 at 7:26 AM, Ivanov Dmitry <usr345@gmail.com> wrote:

> Suppose, I have the code:
>
> (defun dummy ()
>       (interactive)
>       (message "aaa"))
>
> (local-set-key (kbd "<left>") 'dummy)
>
> When you click <left> key in the current buffer, it will print "aaa".
>
> Is it possible to attach this action to any key pressed?
>
> I looked into "Format of Keymaps" and "Searching Keymaps" in Emacs info
> pages, but found no code examples.
>

[-- Attachment #2: Type: text/html, Size: 995 bytes --]

  reply	other threads:[~2013-06-05  6:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05  5:26 Emacs attach an action to any key pressed Ivanov Dmitry
2013-06-05  6:44 ` Magnar Sveen [this message]
2013-06-05  7:56   ` Ivanov Dmitry
2013-06-05 13:24     ` Kevin Rodgers
2013-06-05 13:02 ` Stefan Monnier
2013-06-05 13:48   ` Ivanov Dmitry

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALVcYyCNzkEoF+QP5jzXGFSqVUyuFdvr5sF5bHUG-vf=339zGg@mail.gmail.com' \
    --to=magnar@kodemaker.no \
    --cc=emacs-devel@gnu.org \
    --cc=usr345@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.