Drop-down on-screen keyboard howto

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Drop-down on-screen keyboard howto

#1 Post by technosaurus »

If you have a tablet PC, don't have a keyboard handy, or need to be able to operate one-handed using only a mouse; having an always available on-screen keyboard can be really handy. It is really easy with jwm in Puppy.
You will need an on-screen keyboard program for this to work - I have included a simple one called xvkbd, but have tested it with gtkeyboard as well.

add this to a standard puppy's /root/.jwmrc-tray for a dropdown keyboard (right after the <JWM> tag)

<Tray autohide="true" halign="center" valign="top"><Swallow name="xvkbd">xvkbd -no-keypad</Swallow></Tray>

remove -no-keypad if you want the number pad

to get a pop-UP menu instead (for macPup style with a top task bar), just change valign="top" to valign="bottom"

(may interfere with ptray - fixed by setting halign= or valign to a different locations)
Attachments
xvkbd.gz
here is a copy of the executable - just gunzip it in /usr/bin
(31.17 KiB) Downloaded 1600 times
osk.png
(62.08 KiB) Downloaded 3567 times
Last edited by technosaurus on Sun 18 Apr 2010, 14:31, edited 1 time in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2 Post by zigbert »

technosaurus

Cool feature

I will integrate with the next Ptray


Thank you
Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

Hi again
Your work gave me an idea.
Image
Since xvkbd worked well Ptray, I also added a calculator. :)
This technique can be used for several tasks. notepad, filesearch.....
I tried xpad and fileedit, but they didn't work well. Then I made my own test-notepad, but jwm wouldn't swallow it. Have you solved an issue like this before ???

Code: Select all

#!/bin/sh
export Pnote='
<window width-request="300" height-request="200">
 <edit><variable>PAD</variable><input file>/tmp/pnote</input></edit> 
 <action signal="hide">echo $PAD > /tmp/pnote</action>
</window>'
gtkdialog3 -p Pnote

Thanks
Sigmund

User avatar
lwill
Posts: 171
Joined: Fri 13 Jun 2008, 04:00
Location: City Of Lights
Contact:

#4 Post by lwill »

Quite some time ago I made a small button for the tray to switch the left and right mouse buttons for a "ProGear" tablet I was playing with using 2.17.
http://www.murga-linux.com/puppy/viewto ... 907#208907
Since with a touch screen you cannot "right click" it worked well, but was very simple. I am sure some one could make a much better looking one than I did. I still have the code somewhere if you think it would be a useful.

(I actually drug it out the other day and got it to work as a baby video monitor. Pretty slow with only "b" wireless, but worked)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#5 Post by technosaurus »

@Zigbert: name="xvkbd" (for instance) has to be the correct name
top or pprocess may give you the proper name (I use a gtk1 app called gps) - gtkdialog has the ability to change these, correct?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#6 Post by zigbert »

technosaurus
You're right

Thanks a lot
Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#7 Post by zigbert »

Image

Code: Select all

#!/bin/sh

#set gtk-theme
echo 'style "menu" {
  font_name				= "DejaVu sans italic 14"
  bg[NORMAL]			= "#FFF4AF"
  base[NORMAL]			= "#FFF4AF"
  text[NORMAL]			= "#222222"
  }
class "*t*" style "menu"' > /tmp/gtkrc
export GTK2_RC_FILES=/tmp/gtkrc:/root/.gtkrc-2.0

[ ! -d $HOME/.stardust ] && mkdir $HOME/.stardust

export Pnote='
<window width-request="330" height-request="600">
 <edit left-margin="10"><variable>PAD</variable><input file>'$HOME'/.stardust/pnote</input></edit> 
 <action signal="leave-notify-event">echo "$PAD" > $HOME/.stardust/pnote</action>
</window>'
gtkdialog3 -p Pnote --name=pnote

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#8 Post by 01micko »

oooh ziggy

Nice!

Image

Looking forward to the next DuDE :D

Cheers

edit: did you mean focus with xvkbd? That is working for me too. :)
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#9 Post by zigbert »

Mick
Yes, everything works normally when you run Pnote 'the normal way', but the intention here is much cooler..... 8) To run it inside a autohidden jwm-tray. - then I get the focus bug.....

Though, I have managed to build some kind of workaround


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#10 Post by zigbert »

I am not able to change keyboard layout (I want norwegian) as described in the manual. Is it the compile, Puppy, me, ???....


Sigmund

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#11 Post by technosaurus »

There were additional language type files included in the source, but Puppy is missing some templates from imake, so I built just the binary using a gcc one-liner with parameters taken from the included imake files

Those files may need to go in /usr/shared/??? or they may have compiled in, but it is worth downloading the source for the documentation, since there are quite a few optional parameters.

... usually the parameter would be something like
-DATADIR=\"/usr/share/xvkbd\"
however I do not recall needing to add that to get it to compile
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Revolverve
Posts: 255
Joined: Sat 08 Nov 2008, 21:01
Location: 45°17'28.8"N 72°16'08.8"W_avatar/ mira.ca

#12 Post by Revolverve »

Hmmm,5 years ago here,

I was wondering if someone could explain/help me
-why this xvkbd integration to jwm make it ¨autofocus¨??? witch is the tablet/wacom/touchscreen* friendliest way i found to use xvkbd on these.

*finger touch cannot reach border to activate drop-down thing...is there any other way than offsetting calibration to get it reachable or ask Joe jwm to rewrite tray with an option to let a given number of pixels to activate it easily?

Any ideas?

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#13 Post by rufwoof »

Revolverve wrote:Hmmm,5 years ago here,

I was wondering if someone could explain/help me
-why this xvkbd integration to jwm make it ¨autofocus¨??? witch is the tablet/wacom/touchscreen* friendliest way i found to use xvkbd on these.

*finger touch cannot reach border to activate drop-down thing...is there any other way than offsetting calibration to get it reachable or ask Joe jwm to rewrite tray with an option to let a given number of pixels to activate it easily?

Any ideas?
http://homepage3.nifty.com/tsato/xvkbd/#howtocustomize

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#14 Post by rufwoof »

Do you have a /etc/X11/app-defaults/XVkbd file?

if so add something like

xvkbd.windowGeometry: 800x260

to the end of that file to set the size of the keyboard or something like

xvkbd.windowGeometry: 800x260+100+100

to set the size and the top left location of where the keyboard is opened.

User avatar
Revolverve
Posts: 255
Joined: Sat 08 Nov 2008, 21:01
Location: 45°17'28.8"N 72°16'08.8"W_avatar/ mira.ca

#15 Post by Revolverve »

Thanks rufwoof got all that ...
This in tray xvkbd work fine here,just asking what is the magic trick in that specific setup that make it ¨autofocus=no need to click focus then the target window¨,just a know why curiosity.Could it be something i have never seen yet?like ... a ¨happy¨ bug.... because it works in all puppies with jwm .
Maybe i should ask in a ¨question¨ tag topic than a ¨solution¨ one...it does is a training/how to section to afterall !

Video

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#16 Post by rufwoof »

zigbert wrote:I am not able to change keyboard layout (I want norwegian) as described in the manual. Is it the compile, Puppy, me, ???....


Sigmund
In my /etc/X11/app-defaults folder I have a range of files such as XVkbd-norwegian

If you copy the current XVkbd file in that directory to a backup (perhaps XVkbd.original) and then copy XVkbd.norwegian to XVkbd, then you should see a keyboard relevant to that country.

Alternatively with the keyboard showing click and hold the bottom left key and highlight the Change Keyboard Layout option before releasing the mouse button will pop up a list of different keyboard countries to select from.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#17 Post by greengeek »

Revolverve wrote:This in tray xvkbd work fine here,just asking what is the magic trick in that specific setup that make it ¨autofocus=no need to click focus then the target window¨,just a know why curiosity.Could it be something i have never seen yet?like ... a ¨happy¨ bug.... because it works in all puppies with jwm .
Hi Revolververve - did you ever find out why "autofocus" works ok? I am using Slacko 5.6 (with jwm) but the autofocus does not work. Maybe my jwm is too old? Any ideas?
cheers!

EDIT : Actually I can see that Technosaurus method DOES work on Slacko 5.6 - but the focus behaviour is different depending on how I start xvkbd:
- If I start xvkbd from terminal the autofocus does not work and I must click the focus button before it will type into the text window
- If I start xvkbd from technosaurus's top tray then the autofocus works fine. Crazy but very useful!

Post Reply