Results 1 to 3 of 3

Thread: Intercept Keyboard in VB?

  1. #1

    Thread Starter
    Registered User
    Join Date
    Sep 2001
    Posts
    14

    Question Intercept Keyboard in VB?

    Hello all,
    I am very new to API and hooks so go easy on me please!

    I need to be able to intercept the keyboard in any application from VB. I am using a barcode wedge scanner and would like to be able to catch when a barcode is scanned vs. when someone is using the keyboard. To do this I can add a preamble to the barcode. I need to be able to "watch" the keyboard in VB and detect when this "preamble" is pressed and capture the keys that follow it (all numbers). I also need to prevent these keys from being sent to what ever application that has focus. I have looked into keyboard hooks but from what I have read it doesnt look like this is possible in VB alone.

    I have also considered making that "preamble" a system hotkey that turns on all the number keys as system hotkeys that point to my app and adding a postamble to the end of the barcode that will disable the numbers as hotkeys. that way I would be able to manipulate the barcode any way I want before sending it out to the program that uses it. I am however concerned that a scanner will "press" the keys for the barcode too rapidly to activate the additional hotkeys in time to catch them. Does anyone have any suggestions?
    I would really like to create a hook that would do this if it is possible. Thanks!!!

  2. #2
    jim mcnamara
    Guest
    See Serge's reply and sample code in this thread:

    http://www.vbforums.com/showthread.p...highlight=hook

  3. #3

    Thread Starter
    Registered User
    Join Date
    Sep 2001
    Posts
    14
    It works great on an NT based machine but I cant get it to work on a windows 98 based machine. Any suggestions? Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width