Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Read from Magnetic Stripe

Thread view: 
andrea.ponte@gmail.com - 17 Oct 2006 11:53 GMT
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
Ian Wilson - 17 Oct 2006 17:20 GMT
> 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.
Rodrigo Zechin - 17 Oct 2006 19:05 GMT
On Oct 17, 7:53 am, andrea.po...@gmail.com wrote:
> Hi,
> I've a magnetic stripe reader connected via usb to my pc. When I slide
[quoted text clipped - 4 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.