Read from Magnetic Stripe

Discussion in 'Java' started by andrea.ponte@gmail.com, Oct 17, 2006.

  1. Guest

    Hi,
    I've a magnetic stripe reader connected via usb to my pc. When I slide
    my badge into the reader it write the content of the magnetic card in
    whatever editor is focused in that moment. I need to intercept this
    stream. Another info, my computer see the card reader like a keyboard.
    I've another question too. Is it possible to wrtite a listener that
    focus on my application when I slide the badge into the reader?
    Thanks in advance Andrea
    , Oct 17, 2006
    #1
    1. Advertising

  2. Ian Wilson Guest

    wrote:
    > Hi,
    > I've a magnetic stripe reader connected via usb to my pc.


    I assume Windows.

    > When I slide
    > my badge into the reader it write the content of the magnetic card in
    > whatever editor is focused in that moment. I need to intercept this
    > stream. Another info, my computer see the card reader like a keyboard.


    Commonly called a keyboard-wedge interface.

    > I've another question too.


    Was there an earlier question?


    > Is it possible to wrtite a listener that
    > focus on my application when I slide the badge into the reader?


    I find it hard to work out what your mean. If you want the use of the
    card-reader to change which application has focus then you are probably
    out of luck with your current card-reader.

    If your card has some unique characters at the start then you might be
    able to find a Windows "hotkey" application which could be configured to
    launch your application.

    I think you'd need a card reader with a different sort of interface.
    Then you could probably write an application that listens to that interface.

    Java wouldn't be my first choice for this sort of thing, but maybe
    that's because I'm still a relative novice at it.
    Ian Wilson, Oct 17, 2006
    #2
    1. Advertising

  3. On Oct 17, 7:53 am, wrote:
    > Hi,
    > I've a magnetic stripe reader connected via usb to my pc. When I slide
    > my badge into the reader it write the content of the magnetic card in
    > whatever editor is focused in that moment. I need to intercept this
    > stream. Another info, my computer see the card reader like a keyboard.
    > I've another question too. Is it possible to wrtite a listener that
    > focus on my application when I slide the badge into the reader?
    > Thanks in advance Andrea


    If you have focus on your application, you can set a global
    KeyEventDispatcher to handle this. (Doing this you avoid to implement a
    keyboard listener on every frame, dialog, etc)
    See:
    KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new
    MyDispatcher());

    If you don't have focus, you will need to implement that using JNI...

    RZR
    Rodrigo Zechin, Oct 17, 2006
    #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. Isaac
    Replies:
    0
    Views:
    2,460
    Isaac
    Jul 10, 2003
  2. Brian
    Replies:
    2
    Views:
    530
    Brian
    May 3, 2004
  3. RedEye

    Magnetic Strip Reader API for CF

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

    how to stripe rails comments ?

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

Share This Page