Keyboard input magnetic stripe reader and wxPython

Discussion in 'Python' started by Brian, May 2, 2004.

  1. Brian

    Brian Guest

    This probably has a simple answer:
    I need to capture data from a magnetic stripe reader, which is fed
    through the keyboard port. I want to use wxPython for the application
    (under Windows). I can read this data in a text control, but only if
    the text control has the focus.

    Ideally, I'd use a text control that could be made invisible, and that
    could be forced to have the focus programmatically. That way I could
    use the other text control methods, and not have to write these
    methods from scratch.

    In other words, does a method exist in wxPython that will let me catch
    keyboard characters 'on demand' and store them in a string buffer?

    If you're curious, the application is a museum kiosk, where visitors
    will be able to swipe their credit cards, driver's licenses, etc., and
    see what information is stored there. I'd like to build this from as
    many high-level objects as possible.

    Thanks,
    Brian
     
    Brian, May 2, 2004
    #1
    1. Advertising

  2. Brian

    Roger Binns Guest

    Brian wrote:
    > If you're curious, the application is a museum kiosk, where visitors
    > will be able to swipe their credit cards, driver's licenses, etc., and
    > see what information is stored there. I'd like to build this from as
    > many high-level objects as possible.


    I had a play with one of those once. It was amazing what was on all
    my cards. However it turned out that my MCI calling card crashed
    the unit, and it took 4 hours for them to get it back up again!

    Anyway the answer to your question is to call SetFocus on your
    window/control. (See the documentation for wxWindow.SetFocus).
    You can use EVT_KILL_FOCUS to be notified when losing focus
    and grab it back again. As for having an invisible control,
    I would recommend just making it one pixel by one pixel
    and setting the foreground colour to be the same as the
    background colour.

    Roger
     
    Roger Binns, May 3, 2004
    #2
    1. Advertising

  3. Brian

    Brian Guest

    (Brian) wrote in message news:<>...
    > This probably has a simple answer:


    Yes it does!
    From the parent wxWindow of wxTextCtrl...

    text1=wxTextCtrl(....etc....)
    text1.SetFocus()
    text1.Hide()

    -Brian
     
    Brian, May 3, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    654
    Rodrigo Zechin
    Oct 17, 2006
  2. Guilherme Grillo

    reader inside a reader

    Guilherme Grillo, Nov 7, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    545
    sloan
    Nov 7, 2007
  3. RedEye

    Magnetic Strip Reader API for CF

    RedEye, Sep 7, 2005, in forum: ASP .Net Mobile
    Replies:
    5
    Views:
    219
    Dick Grier
    Sep 7, 2005
  4. Arul hari

    how to stripe rails comments ?

    Arul hari, Sep 16, 2009, in forum: Ruby
    Replies:
    1
    Views:
    152
    Glen Holcomb
    Sep 16, 2009
  5. John Gesimondo
    Replies:
    4
    Views:
    141
    Rob Biedenharn
    Feb 11, 2010
Loading...

Share This Page