473,484 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

USB Keyboard / USB Barcode Scanner HELP!

I'm working on an application (OEM) using c# that uses input from a keyboard
and a USB Barcode Scanner.

I need to be able to identify keystrokes from the barcode scanner and remove
them from the message queue, regardless of what application has focus.

I can identify the keystrokes and input device by registering for raw input
(RegisterRawInputDevices) and processing the WM_INPUT message. This gives
me the keystrokes and the ability to identify the USB Scanner.

I can cancel keystrokes using WH_KEYBOARD_LL and returning "-1" from my
callback.

*** Here's The Issue ***

However, the keyboard hook (WH_KEYBOARD_LL) is processed BEFORE the raw
input (WM_INPUT). When I cancel the keystrokes in the hook, the raw input
never appears.

I'm at a loss on how to resolve this situation. I do not want to write a
device driver (keyboard filter) for my experience with C and writing device
drivers is
extremely limited. I feel like I'm 90% there, and there must be something
simple I'm missing.

Does anybody have any ideas on:

1. Finding a way to get DeviceId from within the WH_KEYBOARD_LL hook.
2. Finding a way to cancel keystrokes from within the Raw Input handler
(WndProc).
3. Alternative solution I have not explored...

Thanks,

-Steven

lo*********@dodgeit.com
(do not reply to this email, it is just for newsgroup postings)


Sep 11 '06 #1
1 11159
Hello,

Sounds like you are doing something very similar to what I have just been
tasked to do...

only thing is I do not have any idea where to start. I would appreciate it
if you could give me some pointers to get me started.

Regards

"Louis Cypher" <lo*********@dodgeit.comwrote in message
news:ex**************@TK2MSFTNGP03.phx.gbl...
I'm working on an application (OEM) using c# that uses input from a
keyboard
and a USB Barcode Scanner.

I need to be able to identify keystrokes from the barcode scanner and
remove
them from the message queue, regardless of what application has focus.

I can identify the keystrokes and input device by registering for raw
input
(RegisterRawInputDevices) and processing the WM_INPUT message. This gives
me the keystrokes and the ability to identify the USB Scanner.

I can cancel keystrokes using WH_KEYBOARD_LL and returning "-1" from my
callback.

*** Here's The Issue ***

However, the keyboard hook (WH_KEYBOARD_LL) is processed BEFORE the raw
input (WM_INPUT). When I cancel the keystrokes in the hook, the raw input
never appears.

I'm at a loss on how to resolve this situation. I do not want to write a
device driver (keyboard filter) for my experience with C and writing
device drivers is
extremely limited. I feel like I'm 90% there, and there must be something
simple I'm missing.

Does anybody have any ideas on:

1. Finding a way to get DeviceId from within the WH_KEYBOARD_LL hook.
2. Finding a way to cancel keystrokes from within the Raw Input handler
(WndProc).
3. Alternative solution I have not explored...

Thanks,

-Steven

lo*********@dodgeit.com
(do not reply to this email, it is just for newsgroup postings)


Sep 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
6376
by: DS | last post by:
Does anyone know anything about barcodes in Access. I don't want to create them in Access. I merely want to scan whats already been created. I need to scan Liquor bottles. I have the scanner...
7
10590
by: Don Riesbeck Jr. | last post by:
I'm working on an application (OEM) using C# that utilizes input from a keyboard, and USB Barcode Scanner. The scanner is a HID Keyboard device, and input from it is sent to the system as if it...
1
6158
by: Darren Coleman | last post by:
I need help with 2 keyboard/input questions 1. How do i caputre all keypress events for my application/form? 2. How do I determine which keyboard sent the keypress? What i'm doing is using a...
4
4500
by: teddysnips | last post by:
I posted yesterday about a project I'm involved in to build a login application using a barcode scanner. I've solved most of the problems, but one remains. The client want to disable keyboard...
2
4048
by: Dan | last post by:
I have an application that uses a COM port barcode scanner. This uses a listener to notify the application when a barcode has been scanned. The application now needs to be modified to use a Human...
2
2366
by: Frank Rizzo | last post by:
I have a barcode scanner that hooks up to a keyboard port. I've figured out how to setup a system-wide keyboard hook. However, how do I distinguish regular keyboard input from the barcode scanner...
5
3247
by: Serdar C. | last post by:
hello everyone, i have a question about retrieving data from a bar code reader plugged in keyboard port (ps/2) i really dont know how to retrieve data from keyboard, i tried some methods but all i...
1
6790
by: Louis Cypher | last post by:
I'm working on an application (OEM) using c# that uses input from a keyboard and a USB Barcode Scanner. I need to be able to identify keystrokes from the barcode scanner and remove them from the...
2
4776
by: pesobol | last post by:
I am using a wedge barcode scanner to enter data in an access database, but for certain combinations of characters I want to parse the input in code and react accordingly. The keypress event on...
0
6947
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6808
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7177
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4526
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3043
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3037
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
586
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
232
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.