Using On-Screen Keyboard in Raspberry Pi OS

Here's what you can do to use a virtual keyboard on Raspberry Pi OS.
Warp Terminal

From Kiosk projects to homelab dashboards, there are numerous usage of a touch screen display with Raspberry Pi.

And it makes total sense to use the on-screen keyboard on the touch device rather than plugging in a keyboard and mouse.

Thankfully, the latest versions of Raspberry Pi OS provide a simple way to install and use the on-screen keyboard.

On-screen keyboard on Raspberry Pi
On-screen keyboard on Raspberry Pi

Let me show how you can install the on-screen keyboard support on Raspberry Pi OS.

πŸ“‹
I am using the DIY Touchscreen by SunFounder (partner link). It's an interesting display that is also compatible with other SBCs. I'll be doing its full review next week. The steps should also work on other touch screens, too.
SunFounder Latest 10 Inch DIY Touch Screen All-In-One Solution for Raspberry Pi 5, IPS HD 1280x800 LCD, Built-In USB-C PD 5.1V/5A Output, HDMI, 10-point, No Driver, Speakers, for RPi 5/4/3/Zero 2W
This SunFounder Touch Screen is a 10-point IPS touch screen in a 10.1β€³ big size and with a high resolution of 1280x800, bringing you perfect visual experience. It works with various operating systems including Raspberry Pi OS, Ubuntu, Ubuntu Mate, Windows, Android, and Chrome OS.

Partner Link

Just check if you already have the on-screen keyboard support

Raspberry Pi OS Bookworm and later versions include the Squeekboard software for the on-screen keyboard feature.

Now, this package may already be installed by default. If you open a terminal and touch the interface and it brings the keyboard, you have everything set already.

It is also possible that it is installed but not enabled.

Go to the menu, then Preferences and open Raspberry Pi config tool. In the display tab, see if you can change the settings for the on-screen keyboard.

On-screen keyboard support already installed on Raspberry Pi
On-screen keyboard support already installed on Raspberry Pi

If you tap the on-screen keyboard settings and it says, "A virtual keyboard is not installed", you will have to install the software first. The next section details the steps.

On-screen keyboard support not installed on Raspberry Pi
Virtual Keyboard is not installed

Getting on-screen keyboard in Raspberry Pi OS Bookworm

🚧
You'll need a physical keyboard and mouse for installing the required package If you cannot connect one, you could try to SSH into the Pi.

Update the package cache of your Raspberry Pi first:

sudo apt update

The squeekboard package provides the virtual keyboard in Debian. Install it using the command below:

sudo apt install squeekboard

Once installed, click on the menu and start Raspberry Pi Configuration from the Preferences.

Accessing Raspberry Pi Config
Access Raspberry Pi Configuration

In the Raspberry Pi Configuration tool, go to the Display tab and touch it.

Enabling on-screen keyboard in Raspberry Pi

You'll see three options:

  • Enabled always: The on-screen keyboard will be always accessible through the top panel, whether you are using touchscreen or not.
  • Enabled if touchscreen found: The on-screen keyboard is only accessible when it detects a touchscreen.
  • Disabled: Virtual keyboard won't be accessible at all.

Out of these three, you'll be tempted to go for the 'Enabled if touchscreen found'.

However, it didn't work for me. I opted for Enabled always instead.

But not all applications will automatically bring up the on-screen keyboard. In my case, Chromium didn't play well. Thankfully, the on-screen keyboard icon at top panel lets you access it at will.

Virtual keyboard comes up for supported application
Virtual keyboard comes up for supported application but it is also accessible from top panel

And this way, you can enjoy the keyboard on a touchscreen.

Conclusion

For older versions of Raspberry Pi OS, you could also go with the matchbox-keyboard package.

sudo apt install matchbox-keyboard

Since Squeekboard is for Wayland, perhaps Matchbox will work on Xorg display server.

The official documents of SunFounder's Touchscreen mentions that Squeekboard is installed by default in Raspberry Pi OS but that was not the case for me.

Installing it was matter of one command and then the virtual keyboard was up and running. This is tested on Raspberry Pi OS but since Squeekboard is available for Wayland in general, it might work on other operating systems, too.

πŸ’¬ Did it work for you? If yes, a simple 'thank you' will encourage me. If not, please provide the details and I'll try to help you.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.