View Full Version : On-screen keyboard for touch-screen kiosk...
sferguson
11-09-2003, 11:13 AM
Hi All,
I'm working on a prototype interface for a touch-screen kiosk and need to create a couple of pages that offer the end-user an on-screen keyboard for inputing info.
What's the best way (e.g. simple / straightforward) way to create the keyboard keys, presumably using the button objects available in AMS 5?
Thanks,
-Scott
P.S. If there are a couple different ways that would easily work (...as there's usually more than one way to skin the cat), which method might best lend itself to being "re-purposeable" or importable/exportable from one project to another?
sferguson
11-09-2003, 11:20 AM
Sorry folks, I wasn't watching where I was driving... I meant to post this question in the AMS 5 forum.
Should I re-post it, or is a forum admin likely to relocate it?
MadNav
11-10-2003, 12:29 PM
sferguson
go to the plug-in section ... the IRLuaCOM Action plug-in sounds like that might be what your seeking to get a handle on your project using AMS 5
Hope that helps
sferguson
11-10-2003, 01:19 PM
Thanks for the tip, I'll check it out.
Corey
11-10-2003, 02:38 PM
No plug-in is needed if I am understanding this. just use button images, i.e. snip up your keyboard image into clickable pieces. With the new alpha hit test area feature in 5.0 the buttons don't even have to be rectangular either. :)
The eaiest way to do this BTW for my workflow is in Photoshop. If all the keys are rectangular or square I would just use the slice tool to graphically slice it up and then export, voila done. If the keys and stuff are irregular then you need to create slice sets, i.e. lets say you have 3 rows of parralelogram shaped buttons, simplt create three copies of your file and snip one row into slices in each, i.e. row 1, row 2, row 3. As long as you export as PNG24 the hit areas will be accurately represented in AMS 5.0, even if the images overlap... Don't forget, in 5.0 you can overlap buttons freely and the hit test will accurately translate the correct hit areas.
It's amazing, this is one feature of 5.0 which blows me away. Makes it super easy to create stuff just like this, clickable keyboards, maps, etc.
BTW if you need cool looking keyboard keys check out the ones which come included in the Flash MX button gallery, awesome looking...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
TJ_Tigger
11-10-2003, 03:09 PM
What about those without Photoshop. I use Paint Shop Pro and it will work with .png images and it will create alpha selections, but the alpha selections wont save when I save the image I am working with.
I think I have figured it out. Not a graphics person.
And couldn't you do the samething with a single image and multiple hotspots?
Corey
11-10-2003, 03:38 PM
Yes you could and, of course, whatever works is best. But I believe the button method would give you more control over the user experience. I know I sound like a broken record but I think that's the hallmark of a solid app, the ability to achieve a given result via several different methods.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
would this just work for inputs on an AMS5 project, or can u send keys to another active Windows app?
Corey
01-08-2004, 01:09 AM
You can easily send any data to any app as long as you know how to receive that data on the other end. For example using the obscure Flash shared local object I once created a demo app (search the forum, it's in here somewhere) which allows any AMS app to speak freely back and forth with any other AMS app, ergo you could create seperate .exes and then have them interact at runtime, such as remote control style app windows, etc.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Martin_SBT
01-08-2004, 02:37 PM
Here is something for you! I didnt have time to setup the best demo in the world but it work perfectly. It is a keyboard i did with flash MX, and the keystroke can be sent to your AMS5 project, everything is functional EVEN a CAPS lock button! :)
Give it a try and let me know.
thats cool, but I am looking to be able to send keystrokes to another windows app.
Martin_SBT
01-08-2004, 02:55 PM
What is the windows app you want to send keystrokes to it? Does it support flash FSCommands and gather flash variables? If so, then you can use my flash movie (keyboard.swf) and look into the action code of the AMS5 demo i just posted to know what FScommands to look for... Also, you should check Corey's post that is mentionned aboved, it demonstrate you how to send data back anf forth between AMS files etc... That is very cool!
It's MS streets & Trips, I highly doubt it supports. I basically want the on-screen keyboard that comes with XP, but it is way too small for touchscreen.
Martin_SBT
01-08-2004, 03:05 PM
One thing that you could do is use what i posted along with the DLL that Worm posted some time ago called "Keystrokes.DLL". You could build an AMS5 project that use both of the above and send the keystrokes to your windows app. That should work...
search the forums for "keystrokes.dll" or keystrokes"
I will check it out. Thanks!
sferguson
01-08-2004, 03:14 PM
The following link should take you back to a thread where your likely to find exactly what you're searching for...
Worm's Keystrokes DLL (http://www.indigorose.com/forums/showthread.php?s=&threadid=2752&highlight=keystrokes)
It's worked like a super-champ for me on a couple of recent projects.
(Worm, multo-grazzi - YOU da man!!! :cool: )
One thing to mention, you'll want to play with the timing of "pauses" a bit in order to to get consistent performance. At one point I had my keystrokes running at blinding speeds, then realized they were out-pacing the app a bit depending on LAN network traffic/various size file transfers. The keystroke sequences will also vary from machine to machine, depending on processor speed, ram, OS, etc.
I found it, but are you using it on 4 or 5? I coverted it to 5, but didn't seem to take very well.
Intrigued
01-08-2004, 09:40 PM
I am using AMS 5 Pro and this project file did not open for me properly. I'm hazarding a guess that is because it was produced in AMS 4. Would this be accurate?
Looks like it would be nice to use.
Thank you.
Here are the instructions for using the Keystroke.dll from Worm.
To send normal characters, simply send the character as it would be typed.
For special keys send these codes:
{ENTER} {ESC} {UP} {DOWN} {LEFT} {RIGHT}
{BACKSPACE} or {BS} {HOME} {END} {PGUP} {PGDN} {TAB} {DEL} or {DELETE}
{INS} or {INSERT} {WIN} {PRTSC} {CAPSLOCK} {NUMLOCK} {SCROLLLOCK} {HELP}
{F1}-{F16}
{SLEEP 1000} <-- 1000 miliseconds
{PAUSE 3.5} <-- Pauses 3.5 seconds (while processing event messages)
{AppActivate WindowName} <-- switches to this window
{LMOUSECLICK X Y} <-- Left button mouse click at x/y screen position
{RMOUSECLICK X Y} <-- Right button mouse click at x/y screen position
{MMOUSECLICK X Y} <-- Middle button mouse click at x/y screen position
{CHR 123} <-- Send an ascii code 123 (same as pressing Alt-123
example: {CHR 65} would be A
Procede characters with + for Shift, ^ for Ctrl, % for Alt
example: ^p would be Ctrl-p
You can also group characters for shift/ctrl/alt with parentheses ()
example: %(fx) would be Alt-F Alt-X
To send these special characters {+^%~( as plain characters enclose them in braces
example: {{} would just send {
To send a key multiple times inclose it in braces with a number like {h 3}
example: {DEL 41) would send DELETE key 41 times
Here are the calls:
Function Name: timeGetTime
Return Value type: Long
Calling convention: _stdcall
Function Name: KeyStroke
Function Parameters: "%Keys%",%Length%
Return Value type: Int
Calling convention: _stdcall
Here is a commented command script (note: this is for AMS4, so the script will look different in AMS5, but it is so well commented that you'll probably get it)
%Result% = Dialog.MessageBox ("Instructions", "PLEASE, PLEASE, PLEASE READ TH...", Ok, Information)
// Initialize variables
%TestTime% = "0"
%hWnd% = ""
// Start up Notepad
File.Execute ("Notepad.exe", "", Continue)
// Set a variable to the current time to use for a Time Out
%StartTime% = File.CallDLLFunction ( "%SysDir%\Winmm.DLL", "timeGetTime", "")
// Start loop. This loop will exit once the Notepad Window is found
// or if approx 10 seconds has passed.
WHILE (10 > %TestTime%)
// Get the new time
%TestTime% = File.CallDLLFunction ( "%SysDir%\Winmm.DLL", "timeGetTime", "")
// Convert from milliseconds to seconds
%TestTime% = Evaluate ((%TestTime% - %StartTime%) /1000)
// Look for Notepad that we just executed
%hWnd% = Window.Find ("Untitled - Notepad")
// If the Notepad window is found, set variable to exit loop
IF (%hWnd% <> "")
%TestTime% = "11"
END IF
END WHILE
// At this point, either Notepad has been started and found, or it hasn't
// If it has, we bring it to the front and send the keystrokes
IF (%hWnd% <> "")
Window.BringToFront (%HWnd%)
// Keys to send
%Keys% = "HELLO FROM MY DLL{ENTER}{ENTER}WATCH THIS{ENTER}{ENTER}In 3 Seconds, I'll initiate a save of this..."
// Length of string being sent
%Length% = String.GetLength ("%KEYS%")
%DLLResult% = File.CallDLLFunction ( "%SrcDir%\KeyStrokes.DLL", "KeyStroke", ""%Keys%",%Length%")
ELSE
%Result% = Dialog.MessageBox ("Error", "There was a problem opening No...", Ok, Information)
END IF
rhosk
01-09-2004, 04:58 AM
Actually (I'm sure Worm will chime in soon) in AMS 5 there's one tiny difference we discovered when calling the 'key' string from the dll:
DLL.CallFunction(_SourceFolder.."\\KEYSTROKES.DLL", "KeyStroke", "\""..Keys.."\"", DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
Other than that, everything's the same; awesome dll!
You got it RHosk, the keystrokes being sent to the DLL need to be enclosed in quotes.
Something like this:
Keys="Test 1 2 3{ENTER}"
DLL.CallFunction(_SourceFolder.."\\KEYSTROKES.DLL", "KeyStroke", "\""..Keys.."\"", DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);
Martin_SBT
01-09-2004, 10:25 AM
Here is the keyboard **** i built, just modified it a little bit.
I wanted to make a demo showing you how to use it with the keystroke.dll file from Worm to interact with notepad (then you can modify the code to use you windows app) but i am a little short on time right now. It miss some codes that shouldnt take more than few minutes for an experimented user such as Worm or Corey or Brett. If one of you guys got some time to finish it and post the final results, that would be great. I can also post my FLa if needed.
What it miss is:
When a kit has been hit, it check if notepad is open, and then make it the TOPMOST, and then send the KEYSTROKE.
Also need to detect the FSCommands : BACK, ENTER and SPACE and send corresponding KEYSTROKES using Worm DLL.
Any takers?
Does somebody realized it?
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.