Difference between revisions of "How to install Soft Keyboard"

From LCD wiki
Jump to: navigation, search
(How to install Soft Keyboard)
Line 1: Line 1:
== <big>How to install Soft Keyboard</big> ==
+
{| class="wikitable" border="1" style=" background-color: white;"
<big>This installation tutorial uses "2016-05-27-raspbian-jessie" version for testing. If use wheezy or earlier image, then the step5 and step6 have different file paths, please refer to the virtual-keyboard official installation tutorial for specification.</big>
+
|- style="background-color: #f2f2f2;text-align:center"
 +
| style="color: #ff0000; font-weight:bold;" align="center" |语言选择(Language):
 +
| style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/zh/%E5%A6%82%E4%BD%95%E6%97%8B%E8%BD%AC%E6%98%BE%E7%A4%BA%E5%92%8C%E8%A7%A6%E6%91%B8(%E7%94%B5%E5%AE%B9%E8%A7%A6%E6%91%B8) 中文] 
 +
| style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/How_to_modify_the_display_orientation-CTP(En) EN] 
 +
|}
  
<big>Official reference address (English)
 
http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/</big>
 
  
<big>1. Install the necessary files
+
== <font color="blue">'''How to install Soft Keyboard''':</font> ==
{{code|1=
+
1. Open the “'''config.txt'''” file (the''' “config.txt” '''file is located in /boot):
sudo apt-get update
+
<pre style="border: 1px dashed black;color:black;width: 50%">
sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool
+
sudo nano /boot/config.txt
}}
+
</pre>
2. Install the matchbox-keyboard
 
<pre style="border: 1px dashed black;color:black;width:80%">
 
git clone https://github.com/mwilliams03/matchbox-keyboard.git</big>
 
<big>cd matchbox-keyboard</big>
 
<big>./autogen.sh</big>              </pre>
 
<big>(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)
 
[[File:Soft_Keyboard-01.png|750px]]</big>
 
<big>Continue:</big>
 
{{code|1=
 
<big>sudo make</big>
 
<big>sudo make install</big>}}
 
<big><br />3. Install the shared data library for matchbox-keyboard
 
{{code|1=
 
sudo apt-get install libmatchbox1}}
 
As following:</big>
 
<big>[[File:Soft_Keyboard-02.png|750px]]</big>
 
  
<big>4. Create a virtual keyboard startup script</big>
+
2.Add the statement in the “'''config.txt'''” file, press <font color="purple">'''Ctrl+X''' </font>to exit, press <font color="purple">'''Y''' </font>to save.
<pre style="border: 1px dashed black;color:black;width:80%">
 
<big>sudo nano /usr/bin/toggle-matchbox-keyboard.sh</big>               </pre>
 
<big>Paste the following, press Ctrl + X and Y, to save then exit</big>
 
{{code|1=
 
<big>!/bin/bash</big><big>This script toggle the virtual keyboard</big>
 
  
<big>PID=`pidof matchbox-keyboard`</big>
+
<pre style="border: 1px dashed black;color:black;width: 50%">display_rotate=1 ???????#0: 0; 1: 90; 2: 180; 3: 270</pre>
  
<big>if [ ! -e $PID ]; then</big>
+
3. Restart the '''Raspberry Pi''' after saving.
  
<big>killall matchbox-keyboard</big>
+
<pre style="border: 1px dashed black;color:black;width: 50%">sudo reboot</pre>
 
 
<big>else</big>
 
 
 
<big>matchbox-keyboard -s 50 extended&fi</big>                            }}
 
 
 
<big>Add executable permission for the script above</big>
 
<pre style="border: 1px dashed black;color:black;width:80%">
 
<big>sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh</big>          </pre>
 
 
 
<big><br />5. Add script above to Start menu</big>
 
 
 
<big>sudo nano /usr/share/applications/toggle-matchbox-keyboard.desktop</big>
 
 
 
<big>Paste the following content, press Ctrl + X and Y, to save then exit</big>
 
 
 
<big>[Desktop Entry]</big>
 
 
 
<big>Name=Toggle Matchbox Keyboard</big>
 
 
 
<big>Comment=Toggle Matchbox Keyboard</big>
 
 
 
<big>Exec=toggle-matchbox-keyboard.sh</big>
 
 
 
<big>Type=Application</big>
 
 
 
<big>Icon=matchbox-keyboard.png</big>
 
 
 
<big>Categories=Panel;Utility;MB</big>
 
 
 
<big>X-MB-INPUT-MECHANSIM=True</big>
 
 
 
<big>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)</big>
 
 
 
<big>nano ~/.config/lxpanel/LXDE-pi/panels/panel</big>
 
 
 
<big>7. Find the resembles similar to the following command (default content may be different in different Raspberry Pi versions)</big>
 
 
 
<big>Plugin {</big>
 
 
 
<big>type=launchbar</big>
 
 
 
<big>Config {</big>
 
    <big>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
 
    }
 
  }</big>
 
<big>}</big>
 
 
 
<big>Add the following code to add an icon item</big>
 
  <big>Button {</big>
 
<big>id=toggle-matchbox-keyboard.desktop</big>
 
        <big>}</big>
 
<big>After modifying, would show as below:</big>
 
 
 
<big>[[File:Soft_Keyboard-03.png|750px]]</big>
 
 
 
<big>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.</big>
 
 
 
<big>sudo reboot</big>
 
 
 
<big>P.S. Log into via SSH to see how to change the size of the virtual keyboard</big>
 
 
 
<big>DISPLAY=:0.0 matchbox-keyboard -s 50 extended</big>
 
 
 
<big>DISPLAY=:0.0 matchbox-keyboard -s 100 extended</big>
 

Revision as of 14:41, 19 May 2018

语言选择(Language): 中文 EN


How to install Soft Keyboard:

1. Open the “config.txt” file (the “config.txt” file is located in /boot):

sudo nano /boot/config.txt

2.Add the statement in the “config.txt” file, press Ctrl+X to exit, press Y to save.

display_rotate=1 ???????#0: 0; 1: 90; 2: 180; 3: 270

3. Restart the Raspberry Pi after saving.

sudo reboot