|
|
第5行: |
第5行: |
| | style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/How_to_install_the_LCD_driver EN] | | | style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/How_to_install_the_LCD_driver EN] |
| |} | | |} |
− | == <font color="blue">'''如何安装虚拟键盘'''</font> == | + | == <font color="blue">'''树莓派LCD驱动安装说明(方法1:在线安装)'''</font> == |
| + | <font color=blue> |
| + | 本文适用于全系列树莓派液晶屏,安装过程树莓派主板需连接互联网操作 |
| + | </font> |
| + | <font color="cyan">步骤1,安装Raspbian官方镜像 </font> |
| + | 1)从官方下载最新Raspbian镜像 https://www.raspberrypi.org/downloads/ |
| + | 2)使用SDFormatter格式化TF卡, |
| + | 3)使用Win32DiskImager把官方镜像烧录到TF卡。 |
| + | |
| + | |
| + | |
| | | |
− | 本安装教程使用”2016-05-27-raspbian-jessie”版本进行测试,如使用wheezy或更早版本镜像,则第5、6步所述文件路径有差异,具体请参考virtual-keyboard官方安装教程。
| |
| | | |
− | '''官方参考地址(英文)''' http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/
| |
| | | |
− | 1、 安装必需文件
| |
− | <pre style="border: 1px dashed black;color:black;>
| |
− | sudo apt-get update
| |
− | sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool
| |
− | </pre>
| |
| | | |
| 2、安装编译虚拟键盘matchbox-keyboard | | 2、安装编译虚拟键盘matchbox-keyboard |
第25行: |
第28行: |
| | | |
| [[File:Soft_Keyboard-01.png]] | | [[File:Soft_Keyboard-01.png]] |
− |
| |
− | 接着执行:
| |
− | <pre style="border: 1px dashed black;color:black;width: 50%">
| |
− | sudo make
| |
− | sudo make install
| |
− | </pre>
| |
− | 3、安装虚拟键盘所用的共享库
| |
− | <pre style="border: 1px dashed black;color:black;width: 50%">
| |
− | sudo apt-get install libmatchbox1 </pre>
| |
− | 如下图:
| |
− |
| |
− | [[File:Soft_Keyboard-02.png|750px]]
| |
− |
| |
− | 4、创建虚拟键盘启动脚本
| |
− | <pre style="border: 1px dashed black;color:black;width: 50%">
| |
− | sudo nano /usr/bin/toggle-matchbox-keyboard.sh </pre>
| |
− | 粘贴以下内容并按'''Ctrl + X和Y'''保存退出
| |
− | <pre style="border: 1px dashed black;color:black;width: 50%">
| |
− | #!/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
| |
− | </pre>
| |
− | 给以上脚本增加可执行权限
| |
− | <pre style="border: 1px dashed black;color:black;width: 50%">
| |
− | sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh </pre>
| |
− | 5、把以上脚本增加到开始菜单
| |
− | <pre style="border: 1px dashed black;color:black;>
| |
− | sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop
| |
− | </pre>
| |
− | 粘贴以下内容并按'''Ctrl+X'''和'''Y'''保存退出
| |
− | <pre style="border: 1px dashed black;color:black;width: 50%">
| |
− | [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 </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]]
| |
− |
| |
− | 8、修改完后执行以下命令重启系统,正常可看到屏幕任务栏处多出了一个虚拟键盘图标
| |
− | {{code|1=sudo reboot }}
| |
− | P.S. 通过SSH登陆如何改变虚拟键盘大小
| |
− | {{code|1=DISPLAY=:0.0 matchbox-keyboard -s 50 extended
| |
− | DISPLAY=:0.0 matchbox-keyboard -s 100 extended
| |
− | }}
| |