Shop OBEX P1 Docs P2 Docs Learn Events
How to send keystrokes to pc using the bs1? — Parallax Forums

How to send keystrokes to pc using the bs1?

Luis_PLuis_P Posts: 246
edited 2010-09-03 11:58 in BASIC Stamp
Is hard to believe this can’t be accomplished. I read a “nuts & bolts” document on how to send ASCII Commands to Serial port on a PC.
But doesn’t work. I need the BS1 be able to act like a keyboard and send any key (a,b,c,1,2,3…) to notepad or any other window application.
Do anybody knows how to do this? Please don’t tell me to open an old keyboard and use it as an interface, too hard…


Thanks Luis

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-01 09:35
    A BS1 is not going to be able to do this. It neither has the space for code nor the SHIFTOUT statement that makes it easier. It's not fast enough either. A BS2 could do this. It's more complicated than you think (see here).
  • Luis_PLuis_P Posts: 246
    edited 2010-09-01 10:12
    OK I made a mistake buying the BS1. But I have one BS2. How can I do this with the Basic Stamp 2, Mike?
    Code.. Wiring..

    Gracias.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2010-09-02 19:38
    This thread might be of some interest... I haven't messed with it much since the post, it was a one time solution I needed it for and the timeout period was enough. Using this I don't see why a BS1 would not work, but it depends on your application.

    There are other programs out there such as Visual Basic capable of sending keystrokes to other applications, and receiving serial data from the serial port. That however would require you to write your own Program for that to work properly.


    http://forums.parallax.com/showthread.php?t=116971&highlight=port+schwabe+Keyboard
  • Luis_PLuis_P Posts: 246
    edited 2010-09-03 11:58
    Using a Visual Basic application tha sendkeys is a good idea. But still the V.B app needs to received a command from the BS1 or BS2. When that command sent then the app will send a keystroke according to that command.
    There is something that the Basic Stamp can send to the PC and be recognized by the application? I guess the Basic Stamp has to be connected to the parallel port? or USB?
    The Visual Basic running as an interface is easy:


    10 If x = 1 then ' sent by the BS1 or BS2
    sendkeys.send "{ENTER}"
    end if

    If x = 2 then ' sent by the BS1 or BS2
    sendkeys.send "{TAB}"
    end if
    Goto 10
Sign In or Register to comment.