3

I would like to get some immediate strong visual feedback for the commands I enter in emacs. For example, I would be happy if any key sequence (beginning with a modifier key) that I type appeared in large red letters in the centre of the current frame. Is there any package that does this?

(Currently, the key sequences only appear in the minibuffer, and with some delay. My problem is that I sometimes involutarily insert random letters in my documents because I accidentally press just s instead C-s etc. I'm hoping that stronger visual feedback might make me aware of most instances of such mistakes. I know there are nameless other editors with safeguards against this kind of "typo", but that's a different question.)

Clarification:

  • By immediate, I mean that I would ideally like to see something as soon as I press a control/meta key. If "C-x" shows up once I've pressed down "C" and hit "x", that's maybe also ok. But I don't want to wait until I've type out "C-x s".

  • I only want a feedback signal for command sequences, not for every letter I type. Starting from Drew's answer below, I've now found a couple of packages for creating screen casts, e.g. keystroke or keypression. However, just as showkey, they show all keyboard strokes, including the trivial ones.

  • By "frame", I meant active "window"/subframe. I would like to see a visual signal in the currently active "window"/subframe.

1 Answer 1

3

Library showkey.el (code) gives you what you request, I think.

It defines two global minor modes, which give you two ways to show keys you type:

  • showkey-tooltip-mode – Show only the last key used, in a tooltip. This is refreshed with each such event. By default, it uses large red characters, just as you request.

  • showkey-log-mode – Show a log of such events, in a separate frame. It is refreshed with each new event, and it is kept on top of other frames without stealing the input focus.

Some user options control the behavior:

  • showkey-tooltip-ignored-events and showkey-log-ignored-events are each a list of regexps to match against events that you do not want to show.

  • showkey-tooltip-sleep-time is the number of seconds to pause while showing the tooltip (zero by default).

  • showkey-tooltip-timeout is the number of seconds to show the tooltip, before hiding it. It's also hidden upon any user event, such as hitting another key, but it's always shown for at least showkey-tooltip-sleep-time seconds.

  • showkey-log-frame-alist is an a list of frame parameters for the logging frame.

  • showkey-log-erase-keys is a list of keys that restart logging (erase the log and start it over). For example, if you add RET key to it (?\r) then each time you press Enter the log is restarted from scratch.

1
  • This certainly goes in the right direction! Feedback is still not quite as immediate as I'd have liked it, though, as tooltip only shows up once a command is complete. Jun 5, 2021 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.