The Artima Developer Community
Sponsored Link

Java Answers Forum
How can I use input devices other than keyboard and mouse?

8 replies on 1 page. Most recent reply: Jul 13, 2006 3:57 AM by lawrence lam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 8 replies on 1 page
lawrence lam

Posts: 5
Nickname: ltlam
Registered: Jul, 2006

How can I use input devices other than keyboard and mouse? Posted: Jul 9, 2006 7:45 PM
Reply to this message Reply
Advertisement
Hi, can anyone tell me how can I use the input device(e.g. barcode scanner) other then keyboard and mouse to read the input?(i.e. read the barcode for requesting price of that particular product?)
Thank you very much


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 9, 2006 11:59 PM
Reply to this message Reply
You can set most barcode scanners to 2 operation modes:
Keyboard Wedge or "Standard Mode" (Don't know the exace name).

In keyboard wedge mode the characters read by the scanner are given to the computer system as typed keys. So you don't need additional programming.

For the other mode: I never tried it in Java, but once I had to access a scanner using MS Access. The Scanner wrote the characters into the puffer of the serial com port, so I connected to this puffer (the same way as to access a file, could be different in Java) and used a timer to check if there was something in it.

There exist also device drivers for barcode scanners which launch a "Input" event or something. So you don't need that timer.

But I never tried them.

lawrence lam

Posts: 5
Nickname: ltlam
Registered: Jul, 2006

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 11, 2006 4:16 AM
Reply to this message Reply
Thank you for your help!

so, do you mean that if I use the keyboard wedge mode, the scanner acts like a keyboard and, it will automatically write the numbers(characters) on the command line(therefore, all I need is the readline function???)?

thank you again

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 11, 2006 7:22 AM
Reply to this message Reply
Yes, exactly.

Just make sure to set the scanner to add a RETURN character after the code.

lawrence lam

Posts: 5
Nickname: ltlam
Registered: Jul, 2006

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 11, 2006 9:19 PM
Reply to this message Reply
oh, you can set the scanner?? how?

thank you for your help again

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 12, 2006 5:45 AM
Reply to this message Reply
Read the scanners manual

lawrence lam

Posts: 5
Nickname: ltlam
Registered: Jul, 2006

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 12, 2006 8:47 PM
Reply to this message Reply
Oh, actually, I didn't get the scanner yet, I think anyone can set, right?
Really thanks a lot, you help me a lot^_^

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 12, 2006 11:22 PM
Reply to this message Reply
You're welcome.

Usually with the scanner comes a book with a lot of barcodes in it. They contain special command codes to configure the scanner.
It's not very difficult, just follow the instructions.

lawrence lam

Posts: 5
Nickname: ltlam
Registered: Jul, 2006

Re: How can I use input devices other than keyboard and mouse? Posted: Jul 13, 2006 3:57 AM
Reply to this message Reply
ok, I'll go buy one and try it out, thank you^_^

Flat View: This topic has 8 replies on 1 page
Topic: Still in love with my bag! Previous Topic   Next Topic Topic: JNI Question

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use