[GH-ISSUE #105] Key pressed overlay #79

Closed
opened 2026-02-25 20:32:31 +03:00 by kerem · 11 comments
Owner

Originally created by @Kraymer on GitHub (Jun 8, 2015).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/105

asciinema is a tempting option to screencast one of my app, but the latter is a curses CLI where content printed on screen is not just a translation of pressed keys.

eg: pressing SPC colors current word in yellow and move cursor to next word

so, as it is now, in this particular case, a screencast with no subtitles or accompanying voice is hardly understandable.

Subtler than voice or subtitles, a minimal approach consist to print pressed shortcut keys in a little toast overlay during X second after key press.
Can this feature be considered for a future release or is it outside of asciinema scope?

Originally created by @Kraymer on GitHub (Jun 8, 2015). Original GitHub issue: https://github.com/asciinema/asciinema/issues/105 asciinema is a tempting option to screencast one of my app, but the latter is a curses CLI where content printed on screen is not just a translation of pressed keys. _eg: pressing <kbd>SPC</kbd> colors current word in yellow and move cursor to next word_ so, as it is now, in this particular case, a screencast with no subtitles or accompanying voice is hardly understandable. Subtler than voice or subtitles, a minimal approach consist to print pressed shortcut keys in a little _toast_ overlay during X second after key press. Can this feature be considered for a future release or is it outside of asciinema scope?
kerem 2026-02-25 20:32:31 +03:00
Author
Owner

@ku1ik commented on GitHub (Jul 5, 2015):

Input (key press) recording is something that has been considered a while ago, see here: https://github.com/asciinema/asciinema.org/issues/84

It wasn't a high priority feature so far, but I still think this is a cool idea. I'll reconsider it again. Thanks.

<!-- gh-comment-id:118665363 --> @ku1ik commented on GitHub (Jul 5, 2015): Input (key press) recording is something that has been considered a while ago, see here: https://github.com/asciinema/asciinema.org/issues/84 It wasn't a high priority feature so far, but I still think this is a cool idea. I'll reconsider it again. Thanks.
Author
Owner

@acornejo commented on GitHub (Sep 6, 2015):

+1 on something like this. I love asciinema btw!

At first i thought something like this might be doable outside asciinema using tmux and some other tool, but i've found no alternatives so far .If asciinema were to dump all stdin into a file, pipe or socket, then perhaps an additional tool could be build that read and displayed that in a tmux pane. That being said, it would be even better if asciinema just had an option that allows the recorded keystrokes to be seen outside the video.

<!-- gh-comment-id:138016160 --> @acornejo commented on GitHub (Sep 6, 2015): +1 on something like this. I love asciinema btw! At first i thought something like this might be doable outside asciinema using tmux and some other tool, but i've found no alternatives so far .If asciinema were to dump all stdin into a file, pipe or socket, then perhaps an additional tool could be build that read and displayed that in a tmux pane. That being said, it would be even better if asciinema just had an option that allows the recorded keystrokes to be seen outside the video.
Author
Owner

@absorber commented on GitHub (Mar 14, 2016):

+1

There's a whole world of terminal interactivity not being shown yet through only terminal input/output recording.

<!-- gh-comment-id:196448421 --> @absorber commented on GitHub (Mar 14, 2016): +1 There's a whole world of terminal interactivity not being shown yet through only terminal input/output recording.
Author
Owner

@laughedelic commented on GitHub (May 11, 2016):

@sickill any plans on this?

<!-- gh-comment-id:218614269 --> @laughedelic commented on GitHub (May 11, 2016): @sickill any plans on this?
Author
Owner

@ku1ik commented on GitHub (May 12, 2016):

I'm keeping it open as I'd like to add this one day. Other priorities for now.

<!-- gh-comment-id:218676491 --> @ku1ik commented on GitHub (May 12, 2016): I'm keeping it open as I'd like to add this one day. Other priorities for now.
Author
Owner

@roxma commented on GitHub (Aug 9, 2016):

+1
I'm preparing a presentation on vim for my colleagues,It would be really nice if I could get some trivial operations record by asciinema with a key overlay.

<!-- gh-comment-id:238597734 --> @roxma commented on GitHub (Aug 9, 2016): +1 I'm preparing a presentation on vim for my colleagues,It would be really nice if I could get some trivial operations record by asciinema with a key overlay.
Author
Owner

@Kraymer commented on GitHub (Nov 6, 2016):

Follow-up of of my initial request 16+ months later : https://github.com/Kraymer/asciiplex 🎦

To reuse @acornejo words :

If asciinema were to dump all stdin into a file, pipe or socket, then perhaps an additional tool could be build that read and displayed that in a tmux pane.

Add a keylogger in the mix, and that's basically what asciiplex is about.
More like a proof of concept right now, as the display of key pressed is not optimal right now (too short ). That would be the first thing to improve + linux compatibility (using logkeys keylogger).
=> PR welcomed

<!-- gh-comment-id:258720159 --> @Kraymer commented on GitHub (Nov 6, 2016): Follow-up of of my initial request 16+ months later : https://github.com/Kraymer/asciiplex 🎦⏺ To reuse @acornejo words : > If asciinema were to dump all stdin into a file, pipe or socket, then perhaps an additional tool could be build that read and displayed that in a tmux pane. Add a keylogger in the mix, and that's basically what asciiplex is about. More like a proof of concept right now, as the display of key pressed is not optimal right now (too short ). That would be the first thing to improve + linux compatibility (using [logkeys](https://github.com/kernc/logkeys) keylogger). => PR welcomed
Author
Owner

@Kraymer commented on GitHub (Dec 11, 2016):

Following-up to my short-lived false-hope asciiplex solution (see previous comment), I have an announcement : asciiplex is dead, long live keyriban!

Unlike asciiplex which was tightly coupled with tmux inner workings 😢 (specifically: status bar update mechanism) , keyriban is a a unixy tool that print in your terminal the sequence of last keys pressed.

Using it in a dedicated thin tmux panel is a way to add key press captioning to your asciicasts.
DEMO HERE: https://asciinema.org/a/95746

<!-- gh-comment-id:266292181 --> @Kraymer commented on GitHub (Dec 11, 2016): Following-up to my short-lived false-hope asciiplex solution (see previous comment), I have an announcement : asciiplex is dead, long live [keyriban](https://github.com/Kraymer/keyriban)! Unlike asciiplex which was tightly coupled with tmux inner workings 😢 (specifically: status bar update mechanism) , keyriban is a a unixy tool that print in your terminal the sequence of last keys pressed. Using it in a dedicated thin tmux panel is a way to add key press captioning to your asciicasts. **DEMO HERE:** https://asciinema.org/a/95746
Author
Owner

@ylluminate commented on GitHub (Jun 24, 2017):

Great to see this getting some life. This is really a super useful function. This integration with kerrigan should be wrapped into the build. @Kraymer is there a way to limit what is logged / shown on the screen so that only keypresses with modifiers are logged (i.e., regular keypresses while typing commands are not shown)? Also, this seems as though it could be integrated into a zsh prompt so as to eliminate the need for tmux...

<!-- gh-comment-id:310859634 --> @ylluminate commented on GitHub (Jun 24, 2017): Great to see this getting some life. This is really a super useful function. This integration with `kerrigan` should be wrapped into the build. @Kraymer is there a way to limit what is logged / shown on the screen so that only keypresses with modifiers are logged (i.e., regular keypresses while typing commands are not shown)? Also, this seems as though it could be integrated into a zsh prompt so as to eliminate the need for `tmux`...
Author
Owner

@Kraymer commented on GitHub (Jun 24, 2017):

@Kraymer is there a way to limit what is logged / shown on the screen so that only keypresses with modifiers are logged

nope, please open an issue on keyriban issue tracker

<!-- gh-comment-id:310868027 --> @Kraymer commented on GitHub (Jun 24, 2017): @Kraymer is there a way to limit what is logged / shown on the screen so that only keypresses with modifiers are logged nope, please open an issue on keyriban issue tracker
Author
Owner

@ku1ik commented on GitHub (Nov 26, 2017):

New asciicast v2 format has a place for keypresses (github.com/asciinema/asciinema@fb1e25d933/doc/asciicast-v2.md (i---data-read-from-stdin)) and soon-to-be-released asciinema 2.0 allows recording of stdin (github.com/asciinema/asciinema@fb1e25d933 (rec-filename)).

The only missing piece for this is implementation of overlay in the web player. I've opened issue in player's repo: https://github.com/asciinema/discussions/issues/152. Feel free to follow it there, closing this one.

Thanks everyone for your input!

<!-- gh-comment-id:346974651 --> @ku1ik commented on GitHub (Nov 26, 2017): New asciicast v2 format has a place for keypresses (https://github.com/asciinema/asciinema/blob/fb1e25d933851743f4aed744279ab5361af9ad4b/doc/asciicast-v2.md#i---data-read-from-stdin) and soon-to-be-released asciinema 2.0 allows recording of stdin (https://github.com/asciinema/asciinema/tree/fb1e25d933851743f4aed744279ab5361af9ad4b#rec-filename). The only missing piece for this is implementation of overlay in the web player. I've opened issue in player's repo: https://github.com/asciinema/discussions/issues/152. Feel free to follow it there, closing this one. Thanks everyone for your input!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#79
No description provided.