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

来自LCD wiki
跳转至: 导航搜索
 
(未显示同一用户的22个中间版本)
第1行: 第1行:
{| class="wikitable" border="1" style=" background-color: white;"
+
{{lan
|- style="background-color: #f2f2f2;text-align:center"
+
    |cn=http://www.lcdwiki.com/zh/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85%E8%99%9A%E6%8B%9F%E9%94%AE%E7%9B%98(CN)
| style="color: #ff0000; font-weight:bold;" align="center" |语言选择(Language):
+
    |en=http://www.lcdwiki.com/How_to_install_Soft_Keyboard                                                   }}
| style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/zh/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85%E8%99%9A%E6%8B%9F%E9%94%AE%E7%9B%98(CN) 中文] 
+
== <font color="blue">'''如何安装虚拟键盘'''</font>  ==
| style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/How_to_install_Soft_Keyboard EN] 
+
== <font color="red">方法1</font>  ==
|}
+
在命令行中执行:
== <font color="blue">'''How to install Soft Keyboard''':</font>  ==
+
{{code|
 +
sudo apt-get install matchbox-keyboard  }}
 +
此方法安装的虚拟键盘,方法简单,但是按键会比较小,不容易操作。
  
This installation tutorial uses "2016-05-27-raspbian-jessie" version for testing. If use wheezy or
+
== <font color="red">方法2</font>  ==
earlier image, then the step5 and step6 have different file paths, please refer to the
 
virtual-keyboard official installation tutorial for specification.
 
  
Official reference address (English)  http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/
+
'''1、 安装必需文件'''
 
+
<pre style="border: 1px dashed black;color:black;>
1. Install the necessary files
 
<pre style="border: 1px dashed black;color:black;width: 100%">
 
 
sudo apt-get update
 
sudo apt-get update
 
sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool
 
sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool
 
</pre>
 
</pre>
  
2.Install the matchbox-keyboard
+
'''2、安装编译虚拟键盘matchbox-keyboard'''
<pre style="border: 1px dashed black;color:black;width: 100%">
+
<pre style="border: 1px dashed black;color:black;>
 
git clone https://github.com/mwilliams03/matchbox-keyboard.git
 
git clone https://github.com/mwilliams03/matchbox-keyboard.git
 
cd matchbox-keyboard
 
cd matchbox-keyboard
 
./autogen.sh
 
./autogen.sh
</pre>(Note: "./ autogen.sh" execution takes a few minutes, and would show as follows after running correctly; if it doesn’t show as follows, then need to check to see if there are error Popup Window prompt)
+
</pre>(注意:./autogen.sh”执行时间较长约几分钟,正确执行后显示界面如下,如执行完不出现类似以下界面则需检查是否有error提示项)
  
 
[[File:Soft_Keyboard-01.png]]
 
[[File:Soft_Keyboard-01.png]]
  
Continue:
+
接着执行:
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo make
 
sudo make
 
sudo make install
 
sudo make install
 
</pre>
 
</pre>
3. Install the shared data library for matchbox-keyboard
+
'''3、安装虚拟键盘所用的共享库'''
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo apt-get install libmatchbox1                              </pre>
 
sudo apt-get install libmatchbox1                              </pre>
As following:
+
如下图:
  
 
[[File:Soft_Keyboard-02.png|750px]]
 
[[File:Soft_Keyboard-02.png|750px]]
  
4. Create a virtual keyboard startup script
+
'''4、创建虚拟键盘启动脚本'''
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo nano /usr/bin/toggle-matchbox-keyboard.sh                </pre>
 
sudo nano /usr/bin/toggle-matchbox-keyboard.sh                </pre>
Paste the following, press Ctrl + X and Y, to save then exit
+
粘贴以下内容并按'''Ctrl + X和Y'''保存退出
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
#!/bin/bash
 
#!/bin/bash
第54行: 第52行:
 
fi
 
fi
 
                                                               </pre>
 
                                                               </pre>
Add executable permission for the script above
+
给以上脚本增加可执行权限
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh              </pre>
 
sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh              </pre>
5. Add script above to Start menu
+
'''5、把以上脚本增加到开始菜单'''
<pre style="border: 1px dashed black;color:black;width: 100%">
+
<pre style="border: 1px dashed black;color:black;>
 
sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop
 
sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop
 
</pre>
 
</pre>
Paste the following content, press Ctrl + X and Y, to save then exit
+
粘贴以下内容并按'''Ctrl+X'''和'''Y'''保存退出
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
<pre style="border: 1px dashed black;color:black;width: 50%">
 
[Desktop Entry]
 
[Desktop Entry]
第71行: 第69行:
 
Categories=Panel;Utility;MB
 
Categories=Panel;Utility;MB
 
X-MB-INPUT-MECHANSIM=True                                        </pre>
 
X-MB-INPUT-MECHANSIM=True                                        </pre>
6. Create an icon on the taskbar
 
(Note that in this step, must be "pi" user privileges, if you use administrator privileges, will not find the file)
 
<pre style="border: 1px dashed black;color:black">
 
nano ~/.config/lxpanel/LXDE-pi/panels/panel                      </pre>
 
7. Find the resembles similar to the following command (default content may be different in different Raspberry Pi versions)
 
<pre style="border: 1px dashed black;color:black;width:100%">
 
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>
 
Add the following code to add an icon item
 
<pre style="border: 1px dashed black;color:black;width:100%">
 
  Button {
 
id=toggle-matchbox-keyboard.desktop
 
        }                                                              </pre>
 
After modifying, would show as below:
 
[[File:Soft_Keyboard-03.png|750px]]
 
  
8. After modifying, run the following command and re-start the system; you will see a virtual keyboard icon in taskbar on the screen normally.
+
'''6、修改完后执行以下命令重启系统'''
 
{{code|1=sudo reboot  }}
 
{{code|1=sudo reboot  }}
P.S. Log into via SSH to see how to change the size of the virtual keyboard
+
 
 +
'''7、把虚拟键盘增加到任务栏'''
 +
<br><br>
 +
鼠标右键点击任务栏    <br><br>
 +
[[File:虚拟键盘-1.png|750px]]  <br>  <br>
 +
[[File:虚拟键盘-2.png|750px]]  <br>  <br>
 +
[[File:虚拟键盘-3.png|750px]]  <br>  <br>
 +
[[File:虚拟键盘-4.png|750px]]  <br>  <br>
 +
 
 +
 
 +
'''P.S. '''
 +
*如何改变虚拟键盘大小,在命令行中执行:
 
{{code|1=DISPLAY=:0.0 matchbox-keyboard -s 50 extended
 
{{code|1=DISPLAY=:0.0 matchbox-keyboard -s 50 extended
 
DISPLAY=:0.0 matchbox-keyboard -s 100 extended
 
DISPLAY=:0.0 matchbox-keyboard -s 100 extended
 
}}
 
}}
 +
 +
*(其实,在Ubuntu-MATE系统Menu > All 中, 自带有虚拟键盘Keyboard,但是只有字母,没有标点和数字,不太好用)

2021年8月17日 (二) 16:30的最新版本

语言选择

Languages

➤中文
➤EN


如何安装虚拟键盘

方法1

在命令行中执行:

sudo apt-get install matchbox-keyboard  

此方法安装的虚拟键盘,方法简单,但是按键会比较小,不容易操作。

方法2

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,但是只有字母,没有标点和数字,不太好用)