“如何安装虚拟键盘(CN)”的版本间的差异

来自LCD wiki
跳转至: 导航搜索
第66行: 第66行:
 
Categories=Panel;Utility;MB
 
Categories=Panel;Utility;MB
 
X-MB-INPUT-MECHANSIM=True                                        </pre>
 
X-MB-INPUT-MECHANSIM=True                                        </pre>
'''6、在任务栏上创建图标(注意该步骤必须使用"pi"用户权限,如果使用管理员权限,将找不到该文件)'''
 
<pre style="border: 1px dashed black;color:black">
 
nano ~/.config/lxpanel/LXDE-pi/panels/panel                      </pre>
 
'''7、找到类似以下命令(树莓派版本不同可能默认内容有差异)'''
 
<pre style="border: 1px dashed black;color:black;">
 
Plugin {
 
type=launchbar
 
Config {
 
    Button {
 
      id=/usr/share/applications/lxde-x-www-browser.desktop
 
    }
 
    Button {
 
      id=/usr/share/raspi-ui-overrides/applications/pcmanfm.desktop
 
    }
 
    Button {
 
      id=/usr/share/raspi-ui-overrides/applications/lxterminal.desktop
 
    }
 
    Button {
 
      id=/usr/share/applications/wolfram-mathematica.desktop
 
    }
 
    Button {
 
      id=/usr/share/applications/wolfram-language.desktop
 
    }
 
  }
 
}                                                                      </pre>
 
添加以下代码增加一个图标项
 
<pre style="border: 1px dashed black;color:black;">
 
  Button {
 
id=toggle-matchbox-keyboard.desktop
 
        }                                                              </pre>
 
修改完效果如下图所示:
 
  
[[File:Soft_Keyboard-03.png|750px]]
+
'''6、修改完后执行以下命令重启系统'''
 +
{{code|1=sudo reboot  }}
 +
 
 +
'''7、把虚拟键盘增加到任务栏'''
 +
 
 +
[[File:虚拟键盘-1.png|750px]]
 +
[[File:虚拟键盘-2.png|750px]]
 +
[[File:虚拟键盘-3.png|750px]]
 +
[[File:虚拟键盘-4.png|750px]]
 +
 
  
'''8、修改完后执行以下命令重启系统,正常可看到屏幕任务栏处多出了一个虚拟键盘图标'''
 
{{code|1=sudo reboot  }}
 
 
'''P.S. '''
 
'''P.S. '''
 
*如何改变虚拟键盘大小,在命令行中执行:
 
*如何改变虚拟键盘大小,在命令行中执行:
第108行: 第84行:
 
}}
 
}}
  
*执行到,第6步,在任务栏上创建图标时,可能会提示文件找不到,这时我们可以用鼠标在上方任务栏点击右键,Panal Setting>Application Launch Bar > 找到虚拟键盘,添加上去就好了
+
 
  
 
*(其实,在Ubuntu-MATE系统Menu > All 中, 自带有虚拟键盘Keyboard,但是只有字母,没有标点和数字,不太好用)
 
*(其实,在Ubuntu-MATE系统Menu > All 中, 自带有虚拟键盘Keyboard,但是只有字母,没有标点和数字,不太好用)

2020年12月8日 (二) 18:39的版本

语言选择

Languages

➤中文
➤EN


如何安装虚拟键盘

本安装教程使用”2016-05-27-raspbian-jessie”版本进行测试,如使用wheezy或更早版本镜像,则第5、6步所述文件路径有差异,具体请参考virtual-keyboard官方安装教程。

官方参考地址(英文) http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/

1、 安装必需文件

sudo apt-get update
sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool

2、安装编译虚拟键盘matchbox-keyboard

git clone https://github.com/mwilliams03/matchbox-keyboard.git
cd matchbox-keyboard
./autogen.sh
(注意:” ./autogen.sh”执行时间较长约几分钟,正确执行后显示界面如下,如执行完不出现类似以下界面则需检查是否有error提示项)

Soft Keyboard-01.png

接着执行:

sudo make
sudo make install

3、安装虚拟键盘所用的共享库

sudo apt-get install libmatchbox1                              

如下图:

Soft Keyboard-02.png

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 -s 50 extended&
fi
                                                              

给以上脚本增加可执行权限

sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh               

5、把以上脚本增加到开始菜单

sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop

粘贴以下内容并按Ctrl+XY保存退出

[Desktop Entry]
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                                         

6、修改完后执行以下命令重启系统

sudo reboot

7、把虚拟键盘增加到任务栏

虚拟键盘-1.png 虚拟键盘-2.png 虚拟键盘-3.png 虚拟键盘-4.png


P.S.

  • 如何改变虚拟键盘大小,在命令行中执行:
DISPLAY=:0.0 matchbox-keyboard -s 50 extended
DISPLAY=:0.0 matchbox-keyboard -s 100 extended


  • (其实,在Ubuntu-MATE系统Menu > All 中, 自带有虚拟键盘Keyboard,但是只有字母,没有标点和数字,不太好用)