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 user32.dll to hook into the
keyboard messages, but neither method seems to allow for identification of
the device sending the input. Inputs from either device are received and
there is not apparent difference.
Is there a way for either method (DI, or hooks) to identify which keyboard
device input is from? Or, is there another method that I overlooked?
(Note that the scanner cannot send pre-fixes, or be configured as a COM
device.)
Thanks in advance!
Don Riesbeck Jr. 7 10520
I knew I was going to forget something: This application will be running on
Windows 2000, Windows 2000 Server and potentially Windows XP.
Thanks Again
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in
message news:eB*************@TK2MSFTNGP14.phx.gbl... 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 user32.dll to hook into the keyboard messages, but neither method seems to allow for identification of the device sending the input. Inputs from either device are received and there is not apparent difference.
Is there a way for either method (DI, or hooks) to identify which keyboard device input is from? Or, is there another method that I overlooked?
(Note that the scanner cannot send pre-fixes, or be configured as a COM device.)
Thanks in advance! Don Riesbeck Jr.
Are you in control of the Barcodes? If so, you can add a special code to
every encoded string for example, supppose the user can type "PRODUCT X" or
scan "PRODUCT X", the barcode could contain this instead "XXXProduct X" and
your code could always look for the first three starting characters and if
they are XXX then you can assume they came form a scanner.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in
message news:eB*************@TK2MSFTNGP14.phx.gbl... 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 user32.dll to hook into the keyboard messages, but neither method seems to allow for identification of the device sending the input. Inputs from either device are received and there is not apparent difference.
Is there a way for either method (DI, or hooks) to identify which keyboard device input is from? Or, is there another method that I overlooked?
(Note that the scanner cannot send pre-fixes, or be configured as a COM device.)
Thanks in advance! Don Riesbeck Jr.
I wish, but unfortunatly the barcode format is configurable, and must
support third party formats that do not have prefixes.
Thanks,
Don
"james" <no****@hypercon.net> wrote in message
news:Ob**************@TK2MSFTNGP10.phx.gbl... Are you in control of the Barcodes? If so, you can add a special code to every encoded string for example, supppose the user can type "PRODUCT X"
or scan "PRODUCT X", the barcode could contain this instead "XXXProduct X"
and your code could always look for the first three starting characters and if they are XXX then you can assume they came form a scanner.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:eB*************@TK2MSFTNGP14.phx.gbl... 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 user32.dll to hook into the keyboard messages, but neither method seems to allow for identification
of the device sending the input. Inputs from either device are received and there is not apparent difference.
Is there a way for either method (DI, or hooks) to identify which
keyboard device input is from? Or, is there another method that I overlooked?
(Note that the scanner cannot send pre-fixes, or be configured as a COM device.)
Thanks in advance! Don Riesbeck Jr.
I guess you are out of luck then. Data passed in through a wedge comes into
the PC through the keyboard interupt and appears to the computer exactly as
if it were typed. You should re-evaluate your reasons for why you need to
know this, and try to find a more generic way to handle it. i.e. A message
box that states "The scanned data is incorrect" could simply state "The
input data is incorrect" and your problem is solved.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in
message news:Oh****************@TK2MSFTNGP09.phx.gbl... I wish, but unfortunatly the barcode format is configurable, and must support third party formats that do not have prefixes.
Thanks, Don
"james" <no****@hypercon.net> wrote in message news:Ob**************@TK2MSFTNGP10.phx.gbl... Are you in control of the Barcodes? If so, you can add a special code to every encoded string for example, supppose the user can type "PRODUCT X" or scan "PRODUCT X", the barcode could contain this instead "XXXProduct X" and your code could always look for the first three starting characters and if they are XXX then you can assume they came form a scanner.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:eB*************@TK2MSFTNGP14.phx.gbl... > 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 user32.dll to hook into the > keyboard messages, but neither method seems to allow for identification of > the device sending the input. Inputs from either device are received > and > there is not apparent difference. > > Is there a way for either method (DI, or hooks) to identify which keyboard > device input is from? Or, is there another method that I overlooked? > > (Note that the scanner cannot send pre-fixes, or be configured as a COM > device.) > > Thanks in advance! > Don Riesbeck Jr. > >
The Barcode scanner is not a "wedge" in the sense that it is inline with the
keyboard. The keyboard is PS/2 and the BC scanner is USB.
Our application must support input from the keyboard AND scanner. All
barcode data will be parsed by a library but keyboard input will just be
entered into the selected fields on the form.
There must be a way to at least detect that the scanner input is coming...
"james" <no****@hypercon.net> wrote in message
news:O1**************@tk2msftngp13.phx.gbl... I guess you are out of luck then. Data passed in through a wedge comes
into the PC through the keyboard interupt and appears to the computer exactly
as if it were typed. You should re-evaluate your reasons for why you need to know this, and try to find a more generic way to handle it. i.e. A
message box that states "The scanned data is incorrect" could simply state "The input data is incorrect" and your problem is solved.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:Oh****************@TK2MSFTNGP09.phx.gbl...I wish, but unfortunatly the barcode format is configurable, and must support third party formats that do not have prefixes.
Thanks, Don
"james" <no****@hypercon.net> wrote in message news:Ob**************@TK2MSFTNGP10.phx.gbl... Are you in control of the Barcodes? If so, you can add a special code
to every encoded string for example, supppose the user can type "PRODUCT
X" or scan "PRODUCT X", the barcode could contain this instead "XXXProduct X" and your code could always look for the first three starting characters and if they are XXX then you can assume they came form a scanner.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:eB*************@TK2MSFTNGP14.phx.gbl... > 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 user32.dll to hook into the > keyboard messages, but neither method seems to allow for
identification of > the device sending the input. Inputs from either device are received > and > there is not apparent difference. > > Is there a way for either method (DI, or hooks) to identify which keyboard > device input is from? Or, is there another method that I overlooked? > > (Note that the scanner cannot send pre-fixes, or be configured as a
COM > device.) > > Thanks in advance! > Don Riesbeck Jr. > >
Yes, there is. You must write your own driver for the USB device driver.
Then you can do anything you want. Or obtain the API from the vendor of
that device. How do you know for sure it is USB? I thought you said that
was outside your control? If the scanner IS inside your control, then you
can add a PREFIX to the actual scanner hardware so that every bit of scanned
text is pre-pended with some special code. How do you always know it iwl be
a USB scanner and not a serial one? Or a Keyboard wedge? Again, I would
ask what is your business case for needing to know? You will most likely
need to re-design your app.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in
message news:ec**************@TK2MSFTNGP15.phx.gbl... The Barcode scanner is not a "wedge" in the sense that it is inline with the keyboard. The keyboard is PS/2 and the BC scanner is USB.
Our application must support input from the keyboard AND scanner. All barcode data will be parsed by a library but keyboard input will just be entered into the selected fields on the form.
There must be a way to at least detect that the scanner input is coming... "james" <no****@hypercon.net> wrote in message news:O1**************@tk2msftngp13.phx.gbl... I guess you are out of luck then. Data passed in through a wedge comes into the PC through the keyboard interupt and appears to the computer exactly as if it were typed. You should re-evaluate your reasons for why you need to know this, and try to find a more generic way to handle it. i.e. A message box that states "The scanned data is incorrect" could simply state "The input data is incorrect" and your problem is solved.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:Oh****************@TK2MSFTNGP09.phx.gbl... >I wish, but unfortunatly the barcode format is configurable, and must > support third party formats that do not have prefixes. > > Thanks, > Don > > "james" <no****@hypercon.net> wrote in message > news:Ob**************@TK2MSFTNGP10.phx.gbl... >> Are you in control of the Barcodes? If so, you can add a special code to >> every encoded string for example, supppose the user can type "PRODUCT X" > or >> scan "PRODUCT X", the barcode could contain this instead "XXXProduct >> X" > and >> your code could always look for the first three starting characters >> and >> if >> they are XXX then you can assume they came form a scanner. >> >> JIM >> >> >> "Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in >> message news:eB*************@TK2MSFTNGP14.phx.gbl... >> > 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 user32.dll to hook into the >> > keyboard messages, but neither method seems to allow for identification > of >> > the device sending the input. Inputs from either device are received >> > and >> > there is not apparent difference. >> > >> > Is there a way for either method (DI, or hooks) to identify which > keyboard >> > device input is from? Or, is there another method that I overlooked? >> > >> > (Note that the scanner cannot send pre-fixes, or be configured as a COM >> > device.) >> > >> > Thanks in advance! >> > Don Riesbeck Jr. >> > >> > >> >> > >
I meant the barcodes themselves are outside of our control. (they are
supplied by vendors to our customers)
The application is a second generation of a product; we are set on the
machine, and have a couple USB scanners (we sell the whole thing.) We know
what scanners the current customers have, we sold them to them. Some of the
scanners support prefixing some don't we MUST support them all. The problem
is we have several different components which use barcodes and the code
currently used is very complicated. My hope was to have an object that just
monitored keyboard activity, and when it detected input from the barcode it
would simply set a property, and in the key pressed handler, we could just
have something like:
//Check for scan data
if (bcHook.isScan)
{
bctextBox.Text += e.KeyChar;
e.Handled = true;
return;
}
This would allow us to only worry about barcodes in the bctextBox field,
even if another textBox had focus.
I really only need to know if there was activity on the barcode scanner, I
don't need the actual data because it will come through the normal channels.
"james" <no****@hypercon.net> wrote in message
news:u0****************@TK2MSFTNGP14.phx.gbl... Yes, there is. You must write your own driver for the USB device driver. Then you can do anything you want. Or obtain the API from the vendor of that device. How do you know for sure it is USB? I thought you said that was outside your control? If the scanner IS inside your control, then you can add a PREFIX to the actual scanner hardware so that every bit of
scanned text is pre-pended with some special code. How do you always know it iwl
be a USB scanner and not a serial one? Or a Keyboard wedge? Again, I would ask what is your business case for needing to know? You will most likely need to re-design your app.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:ec**************@TK2MSFTNGP15.phx.gbl... The Barcode scanner is not a "wedge" in the sense that it is inline with the keyboard. The keyboard is PS/2 and the BC scanner is USB.
Our application must support input from the keyboard AND scanner. All barcode data will be parsed by a library but keyboard input will just be entered into the selected fields on the form.
There must be a way to at least detect that the scanner input is
coming...
"james" <no****@hypercon.net> wrote in message news:O1**************@tk2msftngp13.phx.gbl... I guess you are out of luck then. Data passed in through a wedge comes into the PC through the keyboard interupt and appears to the computer
exactly as if it were typed. You should re-evaluate your reasons for why you need to know this, and try to find a more generic way to handle it. i.e. A message box that states "The scanned data is incorrect" could simply state "The input data is incorrect" and your problem is solved.
JIM
"Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote in message news:Oh****************@TK2MSFTNGP09.phx.gbl... >I wish, but unfortunatly the barcode format is configurable, and must > support third party formats that do not have prefixes. > > Thanks, > Don > > "james" <no****@hypercon.net> wrote in message > news:Ob**************@TK2MSFTNGP10.phx.gbl... >> Are you in control of the Barcodes? If so, you can add a special
code to >> every encoded string for example, supppose the user can type
"PRODUCT X" > or >> scan "PRODUCT X", the barcode could contain this instead "XXXProduct >> X" > and >> your code could always look for the first three starting characters >> and >> if >> they are XXX then you can assume they came form a scanner. >> >> JIM >> >> >> "Don Riesbeck Jr." <02***********************@nerdlycrap.com> wrote
in >> message news:eB*************@TK2MSFTNGP14.phx.gbl... >> > 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 user32.dll to hook into
the >> > keyboard messages, but neither method seems to allow for identification > of >> > the device sending the input. Inputs from either device are
received >> > and >> > there is not apparent difference. >> > >> > Is there a way for either method (DI, or hooks) to identify which > keyboard >> > device input is from? Or, is there another method that I
overlooked? >> > >> > (Note that the scanner cannot send pre-fixes, or be configured as
a COM >> > device.) >> > >> > Thanks in advance! >> > Don Riesbeck Jr. >> > >> > >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: =WereWolf= |
last post by:
Hi everybody,
i'm working with many USB keyboards, which are recognized as HID keyboards
on WinXP system.
I need to handle input from all those keyboards, and identify the keyboard
who is...
|
by: Brian Basquille |
last post by:
Hello all.
Due to the short time remaining to my project handup for my Air Hockey game,
i've abandoned the idea of implementing it over a network.
But since the only real way to play Air...
|
by: rs |
last post by:
Hi guys,
I am trying to read from a USB keyboard using vb.net and HID classes. the
USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and
is detected in device manager as...
|
by: rs |
last post by:
Hi guys,
I am trying to read from a USB keyboard using vb.net and HID classes. the
USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and
is detected in device manager as...
|
by: steve |
last post by:
Hi All
I need to write a program to read input from barcode scanner.
The program is for a gym and needs to detect when a card is scanned
regardless of which program is currently running ont he...
|
by: dfaber |
last post by:
Hi all,
I have been searching for a keyboard and mouse tracker on linux. I've
read solutions (watch at sourceforge) which look at /proc/interrupts to
check keyboard or mouse activity. I also read...
|
by: Sagaert Johan |
last post by:
Hi
Can someone point me the good direction to start a project that injects
keycodes, or (scancodes ) into the system as if the came from the keyboard.
(like barcodescanners etc.. do)
Johan
|
by: Gerry19 |
last post by:
Hi All,
I'm trying to monitor data passed from a USB Barcode scanner but I
can't find any decent code examples of what I need to do, including
any references I need to include.
I know I need to...
|
by: Newbie |
last post by:
Hello I need to enter a string of the form abc (a string of
characters followed by EOF)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int main(void)
{
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
| |