Ports
May 23, 2013, 03:21:37 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
USB
>
Exclusive access to HID with RawInput
Pages: [
1
]
« previous
next »
Print
Author
Topic: Exclusive access to HID with RawInput (Read 2690 times)
IngAU
Member
Posts: 2
Exclusive access to HID with RawInput
«
on:
February 28, 2011, 11:46:05 am »
Hi,
I have the following problem:
I need to get input from a magnetic stripe reader (MSR) that is connected through USB to a Windows XP O.S. PC.
The MSR works in keyboard emulation (attaching the MSR to the PC adds a new keyboard to DeviceManager->Keyboards).
I found the VID and PID so I think that I can get the input from the device using RawInput.
BUT: how can I get exclusive access to the input stream of the device?
I mean: it seems to me that using RawInput I can get all input streams from all keyboards connected to the PC and using VID and PID I can filter the input so that I can keep only the input from MSR.
But the input stream from MSR keeps on going to the Windows' active application (window).
Is there a way to get exclusive access to an HID device?
I read that mouses and keyboards in WinXP are managed in special way respect of other HID device.
Thank you for any help
Alberto
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1629
Re: Exclusive access to HID with RawInput
«
Reply #1 on:
February 28, 2011, 12:36:45 pm »
DirectInput?
http://msdn.microsoft.com/en-us/library/bb153252%28VS.85%29.aspx
Jan
Logged
IngAU
Member
Posts: 2
Re: Exclusive access to HID with RawInput
«
Reply #2 on:
March 01, 2011, 09:36:18 am »
Thank you very much Jan.
Very good answer in very short time.
So you need to use DirectInput and set CooperativeLevel flags to get exclusive access to the HID device.
There is no similar functionality in RawInput (I cannot guess the reason of that, but so it is and with that I have to deal).
I will give it a try.
Thank you again.
Alberto
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...