USB Keyboard / USB Barcode Scanner HELP!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Louis Cypher

    #1

    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

    louiscypher@dod geit.com
    (do not reply to this email, it is just for newsgroup postings)




  • Bill

    #2
    Re: USB Keyboard / USB Barcode Scanner HELP!

    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" <louiscypher@do dgeit.comwrote in message
    news:exKQi2c1GH A.1336@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
    >
    louiscypher@dod geit.com
    (do not reply to this email, it is just for newsgroup postings)
    >
    >
    >
    >

    Comment

    Working...