Display Pressed Keys In Screencasts With Screenkey (Now With Python 3 And GTK 3 Support)

Screenkey

Screenkey is a tool that shows keystrokes on the screen, great if you're recording screencasts, video reviews or demos.

For those not familiar with Screenkey, here's a quick rundown of its features:

  • Several keyboard translation methods
  • Key composition / input method support
  • Configurable font / size / opacity / position on screen
  • Allows configuring the time the keystrokes should be displayed for
  • Normal / Emacs / Mac / Windows / Linux modifiers mode
  • Can show modifier sequences only
  • Multi-monitor support
  • Multimedia keys support (using FontAwesome 4/5)
  • Repeats compression

The application was updated recently to version 1.0, which adds support for Python 3 and GTK 3 (I actually contributed a small patch that gets its AppIndicator to work with Python 3). This is the first release in 4 years, and it only supports X11 for now - a bug is open for Wayland support so you can track that if you want to see when this is resolved.

[[Edit]] Screenkey has reached version 1.3 now, adding support for showing mouse clicks and modifiers too:

screenkey mouse clicks

The Screenkey package in Ubuntu 20.04 and Debian Bullseye / Sid was actually updated by a Debian maintainer to support Python 3 and GTK 3, but the port wasn't finished (the AppIndicator didn't work for example).

Screenkey indicator and preferences

Other changes in Screenkey 1.0 include:

  • "ISO_Left_Tab" is now also shown as Tab
  • Shift+Shift or Alt+Alt can now be used to toggle screenkey as an
  • alternative to Ctrl+Ctrl
  • More multimedia keys are supported (volume, brightness, playback)
  • Transparency of the window is now independent from the text
  • Screenkey no longer detaches by default from the terminal
  • New "Windows" and "Linux" modifier modes
  • Improved geometry handling by Alberto Fanjul
  • French Translation improvements by Georges Khaznadar

Using Screenkey is as straightforward as it gets. Launch it, start typing, and the keys you press will be shown at the bottom of the screen. 

Toggle Screenkey on / off by pressing one of the following: both Ctrl keys, both Shift keys or both Alt keys at the same time. You may also pause Screenkey by clicking on Show keys menu item from its AppIndicator / tray.

If you want to change the Screenkey text overlay position to something like top, center or fixed, or select a window / region to which the Screenkey overlay should be attached to, open its Preferences from the tray / AppIndicator menu, and check out its position settings. From there you can also change the font face and size, colors, keyboard mode, modifiers mode, and so on.

This is a short video demo of Screenkey I recorded so you can see how it works in real time, and not just in a screenshot:


It's important to note that Screenkey itself doesn't record your desktop screen. Use it in conjunction with a screen recorder. I recommend checking out 4 Tools To Record Your Linux Desktop (Screencast) In 2020.

 How to install Screenkey


[[Edit]] Screenkey 1 is now available in Ubuntu 20.10, Kali Linux Rolling, Debian Sid / Bullseye, Raspbian Testing, Arch Linux / Manjaro Community repository, Fedora 32 and 33 / EPEL 8, with the available version varying between these Linux distribution (1.2 / 1.3 in all cases). Install it as it follows:

Debian Sid or Bullseye / Ubuntu 20.10 or 21.04 / Kali Linux Rolling / Raspbian Testing:

sudo apt install screenkey

Fedora 32 or 33 / EPEL 8:

sudo dnf install screenkey

Arch Linux / Manjaro:

sudo pacman -s screenkey

It's also easy to install Screenkey from source. This way you can install the latest version even if your Linux distribution doesn't provide it in its repositories.

Using the commands below you can install the latest Screenkey release on Debian / Ubuntu and Ubuntu-based Linux distributions, and Fedora. 

  • Debian / Ubuntu and Ubuntu-based Linux distributions like Linux Mint, Pop!_OS, Zorin OS, etc.:
sudo apt install libx11-6 python3-gi gir1.2-gtk-3.0 python3-cairo python3-setuptools python3-distutils-extra fonts-font-awesome gir1.2-appindicator3-0.1 slop wget

wget https://gitlab.com/screenkey/screenkey/-/archive/v1.3/screenkey-v1.3.tar.gz

tar -xvf screenkey-v1.3.tar.gz

cd screenkey-v1.3

sudo ./setup.py install

sudo mkdir -p /usr/local/share/applications

sudo install data/screenkey.desktop /usr/local/share/applications

  • Fedora:
sudo dnf install libX11 libappindicator-gtk3 python3-gobject python3-cairo python3-setuptools python3-distutils-extra fontawesome-fonts slop wget

wget https://gitlab.com/screenkey/screenkey/-/archive/v1.3/screenkey-v1.3.tar.gz

tar -xvf screenkey-v1.3.tar.gz

cd screenkey-v1.3

sudo ./setup.py install

sudo mkdir -p /usr/local/share/applications

sudo install data/screenkey.desktop /usr/local/share/applications

When installed from source, Screenkey may not show up in the applications menu on some desktop environments, in which case you need to logout / relogin. Also, if you use GNOME Shell you'll need to install the AppIndicator support extension (this is installed by default on Ubuntu, but not on Fedora for example).

Remember that Screenkey only works on X11. If you use Wayland and want to use Screenkey (e.g. Fedora Workstation with GNOME uses Wayland by default), logout and choose an X11 session from the login screen.