ScAlAn

Raspberry Pi Virtual keyboard

Task: Add Virtual (screen) keyboard on Raspberry Pi device

Implementation:

Install virtual keyboard application

sudo apt install matchbox-keyboard
sudo reboot

Add a Virtual Keyboard Toggle to the Taskbar

sudo nano /usr/bin/toggle-keyboard.sh

Enter:

#!/bin/bash
PID="$(pidof matchbox-keyboard)"
if [  "$PID" != ""  ]; then
  kill $PID
else
 matchbox-keyboard &
fi

Set executable attribute:

sudo chmod +x /usr/bin/toggle-keyboard.sh
sudo nano /usr/share/raspi-ui-overrides/applications/toggle-keyboard.desktop

Enter:

[Desktop Entry]
Name=Toggle Virtual Keyboard
Comment=Toggle Virtual Keyboard
Exec=/usr/bin/toggle-keyboard.sh
Type=Application
Icon=matchbox-keyboard.png
Categories=Panel;Utility;MB
X-MB-INPUT-MECHANISM=True
cp /etc/xdg/lxpanel/LXDE-pi/panels/panel /home/pi/.config/lxpanel/LXDE-pi/panels/panel
nano /home/pi/.config/lxpanel/LXDE-pi/panels/panel

Enter at the end of file:

Plugin {
  type=launchbar
  Config {
    Button {
      id=toggle-keyboard.desktop
    }
  }
}
sudo reboot

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *

  +  38  =  44