Keyboard input magnetic stripe reader and wxPython

Roger Binns rogerb at rogerbinns.com
Mon May 3 01:25:48 EDT 2004


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





More information about the Python-list mailing list