Sending data to cursor on the PC

Discussion in 'The Projects Forum' started by schafbo, Apr 24, 2010.

  1. schafbo

    Thread Starter New Member

    Apr 24, 2010
    2
    0
    Hi. I'm working on a project for an embedded systems class, a password generator that would send a small string of letters/numbers over the serial port. I am aware of how to send the data over the COM1 port so that it appears in a terminal on the software ide, but what i really want the uC to do is send the data so it appears at the computer's cursor. I haven't had any luck finding details on how to do this, or what is necessary to do this. Is there (hopefully) a simple way to do this? Or am i in over my head, and need to write a separate software application to receive the data from the uC?

    I had assumed the uC would function similar to a serial keyboard, except it only sends text that it generates. My project is based on an article from Elektor magazine (http://www.elektor.com/magazines/2010/march/an-atm18-passepartout.1255765.lynkx)
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    I know you can simulate keypresses in Visual Basic because I did it many years ago. I can't rembember exactly how but it was very straightforward. You can also check that you are in the correct window.
     
  3. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    I don't know about recent versions of Windows, but I seem to remember that on older versions you could open a command prompt with the input redirected from a com port.

    Failing that, the AT keyboard serial interface is very simple, you could make your device connect inline with the machine keyboard. That's how quite a few barcode scanners and security add-ons do it, as it avoids the need for any special software to handle the input.
     
  4. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    You could attach the device to the keyboard input. Using a keyboard encoder IC, you can encode the digits and pass them as keystrokes to the PC (and hit enter if you want)

    Setting up you device as a USB keyboard will do the same thing. Without the need for the PS2 plug
     
  5. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    I wish there was a way to take a closer look at that project without spending money...

    If you're using Hyperterminal as the host on the PC side you can send it ANSI sequences like these;

    <esc><"["><"2"><"J"> = home cursor & clear screen
    <esc><"["><"YY"><";"><"XX"><"f"> = put cursor at y("00".."23"),x("00".."79")
    <esc><"["><"A"> = up-arrow
    <esc><"["><"B"> = down-arrow
    <esc><"["><"C"> = right-arrow
    <esc><"["><"D"> = left-arrow

    Regards, Mike
     
  6. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I wouldn't get into the question of whether you're over your head, but I can't see how you'll ever get the computer to do anything out of the ordinary (and displaying text at the cursor location is out of the ordinary) without writing software on the computer to do it.
     
  7. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    I don't know anything about the software as I just find it after doing a Google search on your behave.

    The following software looks promising to solve your problem. Please post back if it actually works in your situation.

    [​IMG]
     
  8. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Thats right... I remember seeing a creditcard scanner that "types" the number into any available software. If you have the cursor in the "Enter CC# Here" box and swipe the card, the card reader decodes the strip and "types" the CC number into the box.

    It would make sense that that software would be TSR. It can remove ascii characters, like the other data on the card strip (name, exdate, etc..) and use only the account numbers.

    Id give it a whirl. But Im guessing you want a device that you plug into any system and it does this. In that case, I would use a USB keyboard scheme.
     
  9. schafbo

    Thread Starter New Member

    Apr 24, 2010
    2
    0
    Yeah, this should be what i need. That software has a limited time use, but atleast i know that i need a serial to keyboard buffer "wedge". Would something like this (http://www.codeware.co.kr/products/keyboard/keyboard-eng.htm) work as intended?
     
  10. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    A freeware with a time limit. That's outrageous and disgusting. I wouldn't have recommended it to you if I know this.

    I totally agree and understand why software needs to be paid for but its the free choice of the author to label a piece of software as "freeware".
     
  11. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    It can actually be done without having to have any code written for the PC side, you can just utilize the existing system files and drivers..... Basically you would have to have your device emulate a PS2 keyboard or something.... most systems still have PS2 ports available even though most keyboards are now USB, anyway, have your device emulate a PS2 keyboard, plug it into the PC's PS2 connector, this can be used with an existing USB keyboard, the system will see them as 2 separate devices, so when the cursor is at a certain point in the application, any data sent by your device will be displayed in the current selected text/input box..... and the best thing about this, is that it is not application dependent, it will work with any application which require some kind of user input from the keyboard (some POS (point of sale) systems actually use this scheme to get data from card readers).... the only downside is, you will have to learn the PS2 protocols...

    PS2 will be easier to implement than a USB HID device..... so PS2 is still the easier way to implement this without too much code overhead or circuit components....


    here are some usefull sites ...

    http://jpbachy.free.fr/PIC%20Keyboard%20Emulator.htm

    http://www.computer-engineering.org/ps2protocol/



    B. Morse
     
    Last edited: Apr 26, 2010
Loading...