USB keyboard emulator
Michael OBannon
Posts: 19
I'd like to translate an old BS2 design to a Prop chip. The current design emulates standard keyboard keystrokes (triggered by real-world contact closures) and sends them to a PS2 port. Now it's become necessary do the same thing on newer laptop that has no dedicated keyboard port. I understand keyboard scan codes and the keyboard port from the "good old days" when things were simpler, but have no clue how to do this with USB. Could someone give me a hint where to start (hopefully without reading 600+ pages of interface standards)?
Thanks for any help!
Thanks for any help!
Comments
So you can use this in conjunction with·your Basic stamp version - or·dig into the propellor and·with a fullduplexserial or similar object you can do the same - input via your real contact device to stamp or prop - serial out to usb to serial device attached to laptop/pc - application running on pc waiting for a com event - send received data to keyboard buffer - as if typed on the pc !
Post Edited (QuattroRS4) : 1/26/2007 5:13:44 PM GMT
The zip file contains 2 items
an ini file - set com port no,baud rate, and whether the application should be visible.
place the exe and ini file in same path - set the ini to your requirements - default 9600,n,8,1
and app form visibility is 'true' - set this to 'false'. Start the app you will note an icon in the sys tray
open anything e.g notepad.exe - make sure it is highlighted i.e active - tab is blue at the top.
use a null modem cable between 2 pc's - on the second pc start up hyperterminal to same settings.Type in on in hyper terminal and watch what you type appear on the other screen - notepad or what ever is open !!
The sent items will only appear in an active window - just like a normal keyboard - ....
Similarly use stamp serout - to send the data to the pc with the app running.
Or use the 'prop' with any of the·serial objects e.g·FullDuplexSerial
A simple mod would be to alter this prog. to append a text file for datalogging !
I can do that if you are badly stuck
Note: if you chose to make the app invisible - use taskmanager to shut it down ...
········It was designed to run in the background ...
Any difficulty just post it here .... enjoy
Comments from anyone welcome !
EDIT:
······ I have updated this program as requested by a few - the attached program now has supports 'BackSpace' and Arrow keys..
Rgds,
······ Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edited (QuattroRS4) : 3/12/2007 5:50:59 PM GMT
Thanks a lot for the response! This should work out just fine. I will give it a try this weekend and let you know how it goes.
Best regards,
Michael
Do let me know - It should meet your needs...
2125 tilt sensor> eb500 bluetooth> hyperterminal> running 3D Simulation?
SlikD
Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
[noparse][[/noparse]D for 'left arrow'
[noparse][[/noparse]A for 'up arrow'
[noparse][[/noparse]C for 'Right Arrow'
[noparse][[/noparse]B for 'Down Arrow'
for keyboard scancodes what is required
&H25 - 'Left Arrow'
&H26 - 'Up Arrow'
&H27 - 'Right Arrow'
&H28 - 'Down Arrow'
I just included these in the attached application for you - let me know how you go with it ..
explanation of how to use it is posted earlier in this thread...
Rgds,
QuattroRS4
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
and / or·vbruntimes
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edited (QuattroRS4) : 2/18/2007 10:15:15 PM GMT
Unzip the attached and place the file in your c:\windows\system32 folder
depending on your XP system it may be
c:\winnt\system32
then
start,Run
regsvr32 c:\windows\system32\mscomm32.ocx
or if its the 'winnt' type
regsvr32 c:\winnt\system32\mscomm32.ocx·
and press <RETURN>
You should get a 'Succeeded' message box
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edited (QuattroRS4) : 3/12/2007 5:53:35 PM GMT
L,l,<Left Arrow> - any one of these 3 chars through the serial port it will 'inject' the scancode for <Left Arrow> into the keyboard buffer of the P.C as if it were typed/pressed on that p.c
R,r,<Right Arrow>
U,u,<Up Arrow>
D,d,<Down Arrow>
I have removed all other key scan codes from this application as requested
I also have a .NET version created if someone would prefer that.
so -
Basic Stamp Example for Right:
SEROUT 0,16468,[noparse][[/noparse]"R"]
- sends R via PIN0 at 9600,N,8,1 to the P.C running the Application
Propeller Example for Right:
CON
·_clkmode = xtal1 + pll16x
·_xinfreq = 5_000_000
OBJ
·ExtSerial : "FullDuplexSerial
Pub SENDR
·extserial.start(-1, 0, 2, 9600) ' (transmit only)- rxpin,txpin,mode,Baud - depends on your set up
·extserial.str(string("R "))
so following on from that L for left ,U for up,D for Down.
I have attached 'Dinj.Zip'
which contains
Dinj.Pdf - operating instructions
Dinj.exe - the application
Dinj.ini - settings file
I hope that meets the requirements ...
enjoy !
Quattro
(Comments Welcome - good,bad and Ugly !)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edited (QuattroRS4) : 2/19/2007 7:15:22 PM GMT