Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Trying to make a virtual keyboard and I need help! (Update...made)  (Read 4804 times)

0 Members and 1 Guest are viewing this topic.

orion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 649
  • Last login:February 07, 2022, 03:58:03 pm
I'm hopeful someone here can help me out with this. I'm trying to make a virtual keyboard for Xlobby that I can use to type in information in the web browser, ect.  Basically to construct this under Xlobby I need to create a separate batch file or something for every key on the keyboard. All I need to know is how would I code something that when I select a text box with the mouse (example google search box) I can execute it and type in the letter "a" for example. I don't know anything about coding, so I am going to need this explained in a way that I can understand. So far I have figured out that I can open up notepad and copy and paste code like the following into it and simply name it "test.vbs" and it will open up notepad and type some stuff. This doesn't work for me, because I need to select a text box with a mouse and then type. Any help would be appreciated with this, as I have been googling trying to find a solution since 8:00AM EST, and I think my eyes are bleeding! :) Thanks!


code example that's close but no cigar:

Set wshshell = wscript.CreateObject("WScript.Shell")
Wshshell.run "Notepad"
wscript.sleep 100
wshshell.sendkeys "E"
wscript.sleep 150
wshshell.sendkeys "m"
wscript.sleep 180
wshshell.sendkeys "p"
wscript.sleep 100
wshshell.sendkeys "i"
wscript.sleep 200
wshshell.sendkeys "r"
wscript.sleep 300
wshshell.sendkeys "e"
wscript.sleep 100
wshshell.sendkeys " "
wscript.sleep 100
wshshell.sendkeys "w"
wscript.sleep 50
wshshell.sendkeys "a"
wscript.sleep 180
wshshell.sendkeys "s"
wscript.sleep 220
wshshell.sendkeys " "
wscript.sleep 100
wshshell.sendkeys "h"
wscript.sleep 150
wshshell.sendkeys "e"
wscript.sleep 170
wshshell.sendkeys "r"
wscript.sleep 190
wshshell.sendkeys "e"
« Last Edit: November 18, 2009, 04:55:42 pm by orion »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Trying to make a virtual keyboard and I need help!
« Reply #1 on: October 30, 2009, 11:28:12 pm »
I'm not exactly sure what you're asking because all you say is you need a virtual keyboard to input into a textbox. But you don't explain what you want to use as the input device. Let's assume you have a Jukebox with a couple of buttons or a keypad that you want to have something like the "tripple tap" feature of a remote control (eg. Pressing "2" scrolls through ABC, pressing "3" scrolls through DEF etc.) then you would need a variable for a counter, a way to read the keys and a way to output the appropriate key.

Anyway I would take a look at AutoIt or AutoHotKey. They are both quite powerful scripting languages that allow you to write things in Windows to change focus on Windows, minimize, restore, focus a textbox, enter text, etc. Basically everything you would need to do to accomplish what you want in a relatively simple and easy to learn language. Also keep in mind these programs also have very active forums where you can ask for help writing your own script. So I would think about exactly what you want to do, and make a post there explaining what it is you want to achieve (ie. What you have so far is vauge at best).

orion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 649
  • Last login:February 07, 2022, 03:58:03 pm
Re: Trying to make a virtual keyboard and I need help!
« Reply #2 on: October 31, 2009, 12:55:21 am »
Thanks for replying headkaze. I suppose I should state what I am doing first. I am creating an interactive display with a 42 inch ELO LCD touchscreen and an Eee Box. What I need to do is create a web browser page with a virtual keyboard as obviously there will be no physical keyboard in this application. I can create a keyboard in Xlobby, (or any other skinnable HTPC program) however this wouldn't be a true virtual keyboard as it will only interact with elements within Xlobby... say search a music database created within Xlobby. What I can do however is to create a page with individual images for each and every individual key on a keyboard, and then link each and every image to execute a specific file within windows. Hence I need to create an individual script or VBS or EXE or whatever for every single individual key on a keyboard. What I have discovered with a simple send keys VBS script however is that you have to call a specific program into focus for it to work. This doesn't work at all when you are on a web page like map quest for instance where you have to input data into different text boxes. I have looked at AutoHotKey, and Sendinput and all but as a non programmer, all the info is a bit over my head. I am having a hard time interpreting the directions on how to compile these scripts in say VB6 or c++ or what ever as they are all written for people who know a lot more than I do about it. The last time I wrote a bit of code I was 7 and it was under the direction of my Dad and written in pascal for his Apple 2 e. :) All I really need is a simple tutorial on how to generate some code and then compile it so that I can make up all these files. Now I haven't looked at AutoIt, hopefully I can find a solution there. Again, thanks for your reply.
« Last Edit: October 31, 2009, 12:57:02 am by orion »

orion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 649
  • Last login:February 07, 2022, 03:58:03 pm
Re: Trying to make a virtual keyboard and I need help!
« Reply #3 on: November 18, 2009, 04:53:22 pm »
Well someone at the Autoit forums helped me figure out how to skin a GUI, and I figured out the rest myself. All I need to do now is to build a web browser page in Xlobby and I will be good to go! Here is my little virtual keyboard I made if anyone should happen to have a use for it. http://www.mediafire.com/file/1m3miyzny1m/Orion Keyboard.zip

EDIT: Esc, closes it.
« Last Edit: November 18, 2009, 04:59:54 pm by orion »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Trying to make a virtual keyboard and I need help! (Update...made)
« Reply #4 on: November 18, 2009, 05:00:29 pm »
Nice one!  :cheers:

orion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 649
  • Last login:February 07, 2022, 03:58:03 pm
Re: Trying to make a virtual keyboard and I need help! (Update...made)
« Reply #5 on: November 19, 2009, 12:40:54 am »
Nice one!  :cheers:

Thanks! Let me just say, that I really have a new-found appreciation for programming guru's such as yourself! This little project was really taxing on me, but I managed to figure out just enough to be dangerous!  ;D

Kevin Mullins

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4504
  • Last login:February 01, 2021, 01:29:34 pm
    • Me on Myspace
Re: Trying to make a virtual keyboard and I need help! (Update...made)
« Reply #6 on: November 22, 2009, 12:26:04 pm »
I've been looking for something similar for a touchscreen only application.

In your application.......
How are you calling this program up ? (double tapping the text box?)
And how are you "escaping" without a keyboard ?

Been trying to find something that will universally pop up when say a name or something needs entered for certain games and such and to be able to make it go away when done. (ENTER maybe)
Not a technician . . . . just a DIY'er.

orion

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 649
  • Last login:February 07, 2022, 03:58:03 pm
Re: Trying to make a virtual keyboard and I need help! (Update...made)
« Reply #7 on: November 23, 2009, 12:31:40 pm »
I've been looking for something similar for a touchscreen only application.

In your application.......
How are you calling this program up ? (double tapping the text box?)
And how are you "escaping" without a keyboard ?

Been trying to find something that will universally pop up when say a name or something needs entered for certain games and such and to be able to make it go away when done. (ENTER maybe)

Well I'm using this to create a keyboard for a webbrowser in XLobby. All I have to do in that case is have Xlobby launch the orion keyboard EXE and then to close it I have Xlobby run the "close" EXE which is basically just the command "Send("{ESC}")" in Autoit. I suppose you could do something like
wscript.sleep 100
wshshell.sendkeys "{ESC}"
In VBS for the same thing. I have been thinking about how to have it run in some of those touch screen games that require a keyboard for users, but I am not sure how to go about doing that. If you figure that one out please let me know. If I figure it out, obviously I will post that here. If you don't like where they keyboard is on the screen when it's up, you will have to download autoit, and edit the script, and then recompile it. (real easy) You will want to look at line #13
$hGUI = GUICreate("Test", 360, 150, 660, 615, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) and change the numbers "660" for left and right "615" (or is that vise versa... those change the position on the screen) Hope this helps!
« Last Edit: November 23, 2009, 12:36:11 pm by orion »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Trying to make a virtual keyboard and I need help! (Update...made)
« Reply #8 on: December 12, 2009, 05:04:44 am »
Just wanted to mention the Touch-It Virtual Keyboard