Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

How catching a barcode device !!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tiziano fabbri - 26 Apr 2006 20:20 GMT
Hi , I'm finishing a new project and a new request is to catch a Ps2,
simulated keyboard, barcode device. My application is a console application
without forms or others kind of user interface. Also I have a serial
communication in a thread with a several priority, a ftp server  always in
listening status and is possible to run a tool to communicate by second
serial. Alls is concentrate inside a 486 100MHz and 32Mbyte of RAM.
Using 'GetAsyncKeyStatus' I have some problem because I loose sometime key
status if I use a normal thread priority, if I increase the priority I loose
lot of time in the serial communication.
Someone has some tips for me or is prefer to use other kinds of device,
serial for example ?? thank you very much, fabbrit
Paul G. Tobey [eMVP] - 26 Apr 2006 20:33 GMT
Huh?  It sounds to me like you've chosen very poorly in how you connect
things.  Trying to use GetAsyncKeyStatus() is a *hopeless* way to try to
catch every key as it arrives.  It seems like you should have chosen a
different way to connect the barcode scanner, so that you could control the
communication with it (serial comes to mind).

However, since you're probably stuck with what you have, use a low-level
keyboard hook to trap all keyboard events in the system (you'll have to do
this in native code, I think).  For each keypress, you can then do whatever
you need to do, drop the key in a queue for serial transmission or whatever.

Paul T.

> Hi , I'm finishing a new project and a new request is to catch a Ps2,
> simulated keyboard, barcode device. My application is a console
[quoted text clipped - 9 lines]
> Someone has some tips for me or is prefer to use other kinds of device,
> serial for example ?? thank you very much, fabbrit
tiziano fabbri - 27 Apr 2006 05:37 GMT
Hi Paul,

have some example or tip regarding low level way (evC++ I think!?!).

> Huh?  It sounds to me like you've chosen very poorly in how you connect
> things.  Trying to use GetAsyncKeyStatus() is a *hopeless* way to try to
[quoted text clipped - 22 lines]
> > Someone has some tips for me or is prefer to use other kinds of device,
> > serial for example ?? thank you very much, fabbrit
David Owen - 27 Apr 2006 12:17 GMT
Did the manufacturer of the device you're using provide a library for using
their device?  Normally that's the best mechanism available.

David

> Hi Paul,
>
[quoted text clipped - 32 lines]
>> > Someone has some tips for me or is prefer to use other kinds of device,
>> > serial for example ?? thank you very much, fabbrit
Paul G. Tobey [eMVP] - 27 Apr 2006 16:52 GMT
You need a low-level keyboard hook.  Here's some code that I've posted
previously that shows how I call it in a native-code DLL.

http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/browse_frm/thread/b991802a15291ced/7d8815aa46a22ecc?q=low+level+keyboard+hook&
rnum=3#7d8815aa46a22ecc


Paul T.

> Hi Paul,
>
[quoted text clipped - 32 lines]
>> > Someone has some tips for me or is prefer to use other kinds of device,
>> > serial for example ?? thank you very much, fabbrit
tiziano fabbri - 28 Apr 2006 05:37 GMT
Hi Paul, Hi David,

thanks for your help and interesting.

to Paul: I'll try to use yours tips and the documents that you got me the
coordinates, thank you very much.
I'll send you some news in a few days

to David: tha barcode device is a very normal PS2 keyboard that simulate
keyboard inlet. No docs;

bye, fabbrit

> You need a low-level keyboard hook.  Here's some code that I've posted
> previously that shows how I call it in a native-code DLL.
[quoted text clipped - 39 lines]
> >> > Someone has some tips for me or is prefer to use other kinds of device,
> >> > serial for example ?? thank you very much, fabbrit

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.