Make a Keyboard - Using text-input button
eddymouse
Posts: 67
Hi at all!
I 'm remaking a user keyboard to insert text into my project.
Where can I find documentation about text-input button? How it works?
Thanks alessandro
I 'm remaking a user keyboard to insert text into my project.
Where can I find documentation about text-input button? How it works?
Thanks alessandro
0
Comments
You may use a keyboard popup from the Panel system page template. They are just popup pages, and can be copied into your panel. Now you can rename the popup, change the design, etc. to fit to your existing design.
Hint: If you check the button properties of the textbox of the keyboard, in General tab, in "Text" the default is KEYB- This is the identifier you'll get sent by the panel from the keyboard when you push "Done" (i.e. when typed 'Hello' and you push Done, the panel sends 'KEYB-Hello'). But this is also the default identifier from the internal keyboard (i.e. called by 'AKEYB-')
To easily differ between the onboard keyboard and your redesigned one, rename that name to something different, like 'KEYB_MINE-' (now you get 'KEYB_MINE-Hello').
If you need additional keyboards for different functions, just copy that popup.
When I push DONE the panel send a STRING to master on port 10001:1:1. How can I change it?
Thanks
Alessandro
Unfortunately this is a limitation. The strings always are sent on port 1.
Workaround (i.e. in a UI module):
A long time ago I made my own keyboard using button numbers. Getting all the caps, numbers with their shifted chars and other special chars was a royal pain. However, once it was done it works nicely. You simply track the current mode of the panel and the keyboard can be used for anything very easily. A module parses the string, so to speak.
Is there any way to pre-populate the text box (via code), when using this method?
If you want to control how it populates and possibly run it through some filters you pretty much have to create your own keyboard from scratch. Use a standard address port and code for the VT and standard channel port and code for the individual keys. You could probably assign the string out port field and assign each key a single letter string and trap each push in a string event handler but I've never tried that.
So the text box has something when it is shown.
I want to capture a user name, and if it is already set I want to display it for editing, etc.
I beleive if you copy the system template keyboard and keep the same name and put it in a pop up group for keyboards the keyboard copy will take precedence over the system template version of the same name. You can then modify the keyboard as you wish and when you call the above command you'll pop up the remodeled version. If you also need a keyboard with a different name so you can use that name to determine its purpose and how to parse its string you can try an call the "'AKEYB-<initial text>'" command and immediately afterward in code call the pop up for the named keyboard you want. Since the group would be mutally exclusive the AKEYB keyboard probably won't be drawn and the latter called pop up will.