Difference between revisions of "How to install Soft Keyboard"

From LCD wiki
Jump to: navigation, search
Line 10: Line 10:
 
Official reference address (English)  http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/
 
Official reference address (English)  http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/
  
1. Install the necessary files
+
'''1. Install the necessary files'''
 
<pre style="border: 1px dashed black;color:black;width: 100%">
 
<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    </pre>
 
sudo apt-get install libfakekey-dev libpng-dev libxft-dev autoconf libtool    </pre>
2.Install the matchbox-keyboard
+
'''2.Install the matchbox-keyboard'''
 
<pre style="border: 1px dashed black;color:black;width: 100%">
 
<pre style="border: 1px dashed black;color:black;width: 100%">
 
git clone https://github.com/mwilliams03/matchbox-keyboard.git
 
git clone https://github.com/mwilliams03/matchbox-keyboard.git
Line 28: Line 28:
 
sudo make install
 
sudo make install
 
}}
 
}}
3. Install the shared data library for matchbox-keyboard
+
'''3. Install the shared data library for matchbox-keyboard'''
 
{{code|1=
 
{{code|1=
 
sudo apt-get install libmatchbox1                            }}
 
sudo apt-get install libmatchbox1                            }}
Line 35: Line 35:
 
[[File:Soft_Keyboard-02.png|750px]]
 
[[File:Soft_Keyboard-02.png|750px]]
  
4. Create a virtual keyboard startup script
+
'''4. Create a virtual keyboard startup script'''
 
{{code|1=
 
{{code|1=
 
sudo nano /usr/bin/toggle-matchbox-keyboard.sh                }}
 
sudo nano /usr/bin/toggle-matchbox-keyboard.sh                }}
Line 52: Line 52:
 
{{code|1=
 
{{code|1=
 
sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh              }}
 
sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh              }}
5. Add script above to Start menu
+
'''5. Add script above to Start menu'''
 
<pre style="border: 1px dashed black;color:black;>
 
<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
Line 66: Line 66:
 
Categories=Panel;Utility;MB
 
Categories=Panel;Utility;MB
 
X-MB-INPUT-MECHANSIM=True                                        }}
 
X-MB-INPUT-MECHANSIM=True                                        }}
6. Create an icon on the taskbar  
+
'''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)
 
(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">
 
<pre style="border: 1px dashed black;color:black">
 
nano ~/.config/lxpanel/LXDE-pi/panels/panel                      </pre>
 
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)
+
'''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%">
 
<pre style="border: 1px dashed black;color:black;width:100%">
 
Plugin {
 
Plugin {
Line 100: Line 100:
 
[[File:Soft_Keyboard-03.png|750px]]
 
[[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.
+
'''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.'''
 
{{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
 
P.S. Log into via SSH to see how to change the size of the virtual keyboard

Revision as of 18:08, 19 May 2018


语言选择

Languages

➤中文
➤EN


How to install Soft Keyboard:

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.

Official reference address (English) http://ozzmaker.com/virtual-keyboard-for-the-raspberry-pi/

1. Install the necessary files

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

2.Install the matchbox-keyboard

git clone https://github.com/mwilliams03/matchbox-keyboard.git
cd matchbox-keyboard
./autogen.sh
(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)

Soft Keyboard-01.png

Continue:

sudo make
sudo make install

3. Install the shared data library for matchbox-keyboard

sudo apt-get install libmatchbox1

As following:

Soft Keyboard-02.png

4. Create a virtual keyboard startup script

sudo nano /usr/bin/toggle-matchbox-keyboard.sh

Paste the following, press Ctrl + X and Y, to save then exit

#!/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

Add executable permission for the script above

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

5. Add script above to Start menu

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

Paste the following content, press Ctrl + X and Y, to save then exit

[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. 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)

nano ~/.config/lxpanel/LXDE-pi/panels/panel                       

7. Find the resembles similar to the following command (default content may be different in different Raspberry Pi versions)

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
    }
  }
}                                                                      

Add the following code to add an icon item

  Button {
          id=toggle-matchbox-keyboard.desktop
         }                                                               

After modifying, would show as below: Soft Keyboard-03.png

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.

sudo reboot

P.S. Log into via SSH to see how to change the size of the virtual keyboard

DISPLAY=:0.0 matchbox-keyboard -s 50 extended
DISPLAY=:0.0 matchbox-keyboard -s 100 extended