1、安裝必需文件 sudo apt-get install libfakekey-dev libpng-dev -y 2、安裝編譯虛擬鍵盤ato, sans-serif;font-size:16px;font-weight:700;vertical-align:baseline;color:#2B2B2B;background-color:#FFFFFF;">matchbox-keyboard ato, sans-serif;font-size:16px;font-weight:700;vertical-align:baseline;color:#2B2B2B;background-color:#FFFFFF;"> git clone https://github.com/mwilliams03/matchbox-keyboard.git cd matchbox-keyboard ./autogen.sh make sudo make install 3、安裝虛擬鍵盤所用的共享庫 ato, sans-serif;font-size:16px;font-weight:700;vertical-align:baseline;color:#2B2B2B;background-color:#FFFFFF;"> sudo apt-get install libmatchbox1 -y 4、創建虛擬鍵盤啟動腳本 sudo nano /usr/bin/toggle-matchbox-keyboard.sh 粘貼以下內容並按ctrl+x和y保存退出 #!/bin/bash #This script toggle the virtual keyboard PID=`pidof matchbox-keyboard` if [ ! -e $PID ]; then killall matchbox-keyboard else matchbox-keyboard& fi 給以上腳本增加可執行權限 sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh
5、把以上腳本增加到開始菜單
sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop
[Desktop Entry] Name=Toggle Matchbox Keyboard Comment=Toggle Matchbox Keyboard Exec=toggle-matchbox-keyboard.sh Type=Application Icon=matchbox-keyboard.png Categorices=Panel;Utility;MB X-MB-INPUT-MECHANSIM=Ture
go on…\
nano ~/.config/lxpanel/LXDE-pi/panels/panel 找到以下內容 Plugin { type = launchbar Config { Button { id=lxde-screenlock.desktop } Button { id=lxde-logout.desktop } } 改為以下內容 Plugin { type = launchbar Config { Button { id=toggle-matchbox-keyboard.desktop } Button { id=lxde-screenlock.desktop } Button { id=lxde-logout.desktop } } 可以用加參數在啟動時改變虛擬鍵盤大小 matchbox-keyboard -s 50

通過SSH在桌面上顯示可以用這個命令:
DISPLAY=:0.0 matchbox-keyboard
顯示小鍵盤用以下命令參數
matchbox-keyboard -s 50 extended
