How to set up a hard button keyboard toggle

This board posts about running linux on your webdt366
Post Reply
quotaholic
Administrator
Administrator
Posts: 569
Joined: Tue Mar 24, 2009 9:11 pm

How to set up a hard button keyboard toggle

Post by quotaholic »

So I really wanted the hard button for the keyboard to work like the wince keyboard worked. A press for it to show up and another press to make it go away. Thanks to the olpc project I found a simple little script that will work with xvkbd, efl-keys or whatever keyboard you are using.

Code: Select all

sudo nano /usr/bin/togglekbd.sh
#!/bin/bash

if ps ax | grep -v grep | grep xvkbd > /dev/null
then
 /usr/bin/pkill xvkbd
else
 /usr/bin/xvkbd -secure -always-on-top -geometry 798x175-0+362
fi


ctl+o

to save it

ctl+x

to exit nano

Code: Select all

sudo chmod 755 /usr/bin/toggle*
to make it executable

The last step is to adjust your keybindings to aim at this file. I am using xmodmap to handle the button presses. I will post a how to after finishing this post. If you are using the enlightenment window manager open the settings panel from the main menu and "Settings". Toggle the right arrow until you see "Input". Select "Key Bindings" and "Add". Press the hard button for the keyboard and scroll down the list of calls on the pop-up dialog until you see command. Select it and enter:

Enter:
/usr/bin/togglekbd.sh
Apply and Save and exit the settings panel.

Test and make any needed adjustments for position or size. Xvkbd can be set up to connect to a remote display and be fully customized. http://homepage3.nifty.com/tsato/xvkbd/ for more info.

If you use a different keyboard simply substitute each mention of xvkbd with your keyboard and match the postitioning to suit your needs.

Similarly this method can be used to trigger the toggle of any program to a button. Run your browser at full screen on this method. Start an ssh connection, modify xvkbd to have just enough keys to control the entertainment system and run it full screen with pretty pictures behind the buttons. Possibilities are numerous. This is a very versatile script. I hope it finds good use.

quotaholic
Last edited by quotaholic on Sat Aug 22, 2009 10:20 am, edited 1 time in total.
quotaholic
Administrator
Administrator
Posts: 569
Joined: Tue Mar 24, 2009 9:11 pm

Re: How to set up a "borderless" hard button keyboard toggle

Post by quotaholic »

One more thought on this topic.

If you are using E-17 click on the icon in the upper left of the window border. Under "More.." there is a window border option. Select borderless and then the check box to remember the setting. Before you press the button again killing xvkbd click on the "xvkbd" box in the lower left and quit the program through the menu. Readjust your /usr/bin/togglekbd.sh for position. Mine has this line to start the program: xvkbd -secure -always-on-top -no-keypad -geometry 798x195-0+405

Also within the shelf properties go in to advanced and select the option to place the shelf below everything and allow windows to overlap the shelf. Now you should have a perfectly positioned borderless xvkbd that starts and exits by the keyboard hard button. Omit the -no-keypad modifier if you wish to have the number pad on the right side.

quotaholic
Post Reply