473,549 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
+ 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
(RegisterRawInp utDevices) 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*********@dod geit.com
(do not reply to this email, it is just for newsgroup postings)


Sep 11 '06 #1
1 11193
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*********@do dgeit.comwrote in message
news:ex******** ******@TK2MSFTN GP03.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
(RegisterRawInp utDevices) 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*********@dod geit.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
6394
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 hooked up. Any help is appreciated, Thanks DS
7
10609
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 were a keyboard. I need to be able to identify input from the scanner and keyboard independently. I've looked at DirectX.DirectInput, and using...
1
6170
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 USB Barcode scanner, windows sees the scanner as a keyboard. When the scanner reads a barcode it decodes the barcode and sends in the decoded values...
4
4509
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 input (except at some remote sites where there won't be a scanner). The session "knows" whether that site should be keyboard enabled, but...
2
4057
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 Interface Device scanner. This means I need to read in the barcode from the keyboard input and notify the same listeners. This seemed relativly easy...
2
2374
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 input. Does anyone have any ideas? Thanks.
5
3256
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 could get was getting key values like "F7 key", or "Shift key"... can someone tell me how to retrieve data from a bar code scanner please? or at...
1
6803
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 message queue, regardless of what application has focus. I can identify the keystrokes and input device by registering for raw input...
2
4782
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 the form only gives me access to the first character in the string, is there some way to access the keyboard buffer during the keypress event and get...
0
7521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7451
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7473
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5369
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3501
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.