The following is simple code that accepts a line of text from a user:

from tkinter import *
from tkinter import ttk
root= Tk()
entry= ttk.Entry(root, width=30)

text box

I am running this code on a raspberry pi using an external keyboard with a 7 inch touch display. But what I want is that as soon as I click in the text field a simple on-screen keyboard pops up and I am able to enter a string using this keyboard via the touch panel.

I want to know what are the different approaches to accomplish this. Specifically I need a simple small size on-screen keyboard that only needs to have letters a-z.

2 Answers 2


There're a few different keyboard solutions. Two of the most popular are matchbox-keyboard and florence. For matchbox-keyboard, they have a library to interact with auto-hide and auto-show. florence attempts to detect when it should auto-hide and doesn't seem to support auto-show. I'm still looking for an ideal solution myself.

  • Throwing in a plug for onboard as another keyboard option which is more modern & configureable IMHO
    – novwhisky
    Oct 19, 2022 at 18:05

You could use matchbox keyboard: sudo apt install matchbox-key

Your Answer

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

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