Virtual Keyboard for Pi with Auto Hide

I use PyGObject to create a user interface that will run on the 7-inch official RPi touch screen connected to the Pi 3 running Raspbian. Within this interface, the user interface will need an on-screen keyboard. Two virtual keyboard programs for Pi: ​​Matchbox Keyboard and Florence.

The problem is that I want to simulate the behavior of the smartphone keyboard as much as possible, but I don’t know how to do it. What I want to do is similar to this , except that I want the keyboard to hide automatically and be on top of the main window. How can I do that?

EDIT: I tried both of these programs and couldn't figure out how to achieve this. I can’t find the auto popup option in the Matchbox Keyboard, and some people say that it has this feature ( here ), others say that it doesn’t ( here ). I assume that some Linux desktop administrators support this feature, but not LXDE on Pi.

Florence seems promising because it has an auto-hide option that sounds like it will do what I want, but when I select it, it doesn't seem to work.

+4
source share
1 answer

, auto-hide Matchbox Keyboard. --daemon , , , , , , .

README :

matchbox- XEMBED (, GTK2).

examples/matchbox-keyboard-gtk-embed.c , .

, , PyGObject, , . :

p = subprocess.Popen(["matchbox-keyboard", "--xid"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
keyboard = Gtk.Socket()
window.add(keyboard)
keyboard.add_id(int(p.stdout.readline()))

Gtk.Entry, , :

class TextEntry(Gtk.Entry):
    def __init__(self, window):
        Gtk.Entry.__init__(self)
        self.keyboard = window.keyboard

        self.connect("focus-in-event", self.on_focus_in)
        self.connect("focus-out-event", self.on_focus_out)

    def on_focus_in(self, event, data):
        self.keyboard.show()

    def on_focus_out(self, event, data):
        self.keyboard.hide()
+2

All Articles