1. Install prerequisite development files
pi@raspberrypi ~ $ sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool -y
2. Install and compile matchbox-keyboard
pi@raspberrypi ~ $ git clone https://github.com/mwilliams03/matchbox-keyboard.git
pi@raspberrypi ~ $ cd matchbox-keyboard
pi@raspberrypi ~ $ ./autogen.sh
pi@raspberrypi ~ $ make
pi@raspberrypi ~ $ sudo make install
Installation of the shared matchbox libraries needs to be done after the
installation of matchbox-keyboard.
pi@raspberrypi ~ $ sudo apt-get install libmatchbox1 -y
3. Create toggle script to start or stop matchbox-keyboard
We will now create a script to toggle the keyboard on and off. And then add a
menu item to access the script as well as add an icon to the task bar for easy
access.
Create a new file;
pi@raspberrypi ~ $ sudo nano /usr/bin/toggle-matchbox-keyboard.sh
And copy in the text below;
#!/bin/bash
#This script toggle the virtual keyboard
PID=`pidof matchbox-keyboard`
if [ ! -e $PID ]; then
killall matchbox-keyboard
else
matchbox-keyboard&
fi
Now make it executable;
pi@raspberrypi ~ $ sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh
We will now add an item to the start menu.
pi@raspberrypi ~ $ sudo nano /usr/local/share/applications/toggle-matchbox-keyboard.desktop
Name=Toggle Matchbox Keyboard
Comment=Toggle Matchbox Keyboard
Exec=toggle-matchbox-keyboard.sh
Type=Application
Icon=matchbox-keyboard.png
Categories=Panel;Utility;MB
X-MB-INPUT-MECHANSIM=True
To create an icon on the task bar, open up the LXDE panel config;
pi@raspberrypi ~ $ nano ~/.config/lxpanel/LXDE/panels/panel
If the above file is empty, then it is most likely that you have a newer version
of Raspbian, especially if you are using a Pi 2. You then would need to edit
the panel config at this location;
pi@raspberrypi ~ $ nano ~/.config/lxpanel-pi/LXDE/panels/panel
Find this section of config (it is near the bottom);
Plugin {
type = launchbar
Config {
Button {
id=lxde-screenlock.desktop
}
Button {
id=lxde-logout.desktop
}
}
and change it to;
Plugin {
type = launchbar
Config {
Button {
id=toggle-matchbox-keyboard.desktop
}
Button {
id=lxde-screenlock.desktop
}
Button {
id=lxde-logout.desktop
}
}
pi@raspberrypi ~ $ matchbox-keyboard
pi@raspberrypi ~ $ DISPLAY=:0.0 matchbox-keyboard
This will load the default keyboard layout, seen here;
pi@raspberrypi ~ $ matchbox-keyboard -s 50
pi@raspberrypi ~ $ matchbox-keyboard -s 50 extended
Generating keyboard in raspberry pi

Generating keyboard in raspberry pi

  • 1.
    1. Install prerequisitedevelopment files pi@raspberrypi ~ $ sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool -y 2. Install and compile matchbox-keyboard pi@raspberrypi ~ $ git clone https://github.com/mwilliams03/matchbox-keyboard.git pi@raspberrypi ~ $ cd matchbox-keyboard pi@raspberrypi ~ $ ./autogen.sh pi@raspberrypi ~ $ make pi@raspberrypi ~ $ sudo make install Installation of the shared matchbox libraries needs to be done after the installation of matchbox-keyboard. pi@raspberrypi ~ $ sudo apt-get install libmatchbox1 -y 3. Create toggle script to start or stop matchbox-keyboard We will now create a script to toggle the keyboard on and off. And then add a menu item to access the script as well as add an icon to the task bar for easy access. Create a new file; pi@raspberrypi ~ $ sudo nano /usr/bin/toggle-matchbox-keyboard.sh And copy in the text below; #!/bin/bash #This script toggle the virtual keyboard PID=`pidof matchbox-keyboard` if [ ! -e $PID ]; then killall matchbox-keyboard
  • 2.
    else matchbox-keyboard& fi Now make itexecutable; pi@raspberrypi ~ $ sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh We will now add an item to the start menu. pi@raspberrypi ~ $ sudo nano /usr/local/share/applications/toggle-matchbox-keyboard.desktop Name=Toggle Matchbox Keyboard Comment=Toggle Matchbox Keyboard Exec=toggle-matchbox-keyboard.sh Type=Application Icon=matchbox-keyboard.png Categories=Panel;Utility;MB X-MB-INPUT-MECHANSIM=True To create an icon on the task bar, open up the LXDE panel config; pi@raspberrypi ~ $ nano ~/.config/lxpanel/LXDE/panels/panel
  • 3.
    If the abovefile is empty, then it is most likely that you have a newer version of Raspbian, especially if you are using a Pi 2. You then would need to edit the panel config at this location; pi@raspberrypi ~ $ nano ~/.config/lxpanel-pi/LXDE/panels/panel Find this section of config (it is near the bottom); Plugin { type = launchbar Config { Button { id=lxde-screenlock.desktop } Button { id=lxde-logout.desktop } } and change it to; Plugin {
  • 4.
    type = launchbar Config{ Button { id=toggle-matchbox-keyboard.desktop } Button { id=lxde-screenlock.desktop } Button { id=lxde-logout.desktop } } pi@raspberrypi ~ $ matchbox-keyboard pi@raspberrypi ~ $ DISPLAY=:0.0 matchbox-keyboard This will load the default keyboard layout, seen here; pi@raspberrypi ~ $ matchbox-keyboard -s 50 pi@raspberrypi ~ $ matchbox-keyboard -s 50 extended