Page 1 of 1

Drop-down on-screen keyboard howto

Posted: Fri 16 Apr 2010, 19:23
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)

Posted: Fri 16 Apr 2010, 21:20
by zigbert
technosaurus

Cool feature

I will integrate with the next Ptray


Thank you
Sigmund

Posted: Sat 17 Apr 2010, 12:03
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

Posted: Sat 17 Apr 2010, 13:43
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)

Posted: Sat 17 Apr 2010, 16:24
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?

Posted: Sat 17 Apr 2010, 16:48
by zigbert
technosaurus
You're right

Thanks a lot
Sigmund

Posted: Sat 17 Apr 2010, 17:58
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

Posted: Sat 17 Apr 2010, 19:24
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. :)

Posted: Sun 18 Apr 2010, 05:53
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

Posted: Wed 21 Apr 2010, 18:46
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

Posted: Wed 21 Apr 2010, 20:57
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

Posted: Fri 16 Oct 2015, 11:58
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?

Posted: Fri 16 Oct 2015, 12:47
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

Posted: Fri 16 Oct 2015, 13:07
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.

Posted: Fri 16 Oct 2015, 20:56
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

Posted: Tue 27 Oct 2015, 20:12
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.

Posted: Sat 23 Apr 2016, 08:30
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!