CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    Question Low level Keyboard hook and keyboard synthesizes

    Hi gurus,

    my problem is related to keyboard event synthesis on an application which uses low level keyboard hooking.

    application A uses LL hook to capture the function keys and posts messages to some windows when 'LLKHF_UP' is detected. It works fine when we press the function keys on keyboard.

    our application B ( is a kind of remote control app ) synthesizes the keyboard events using keybd_event function ( A and B runs in same machine )

    It seems that when using keybd_event, the hooked application never gets LLKHF_UP flag, instead it gets 'LLKHF_INJECTED' ( it is logical ). but why didn't it get the up event? [ up flag is set on the keybd_event fn ]

    I tried it with the windows virtual keyboard, which also displays the same behavior.

    Now is there ANY way to simulate the up flag in app A ?
    Please put some thoughts
    Thanks

  2. #2
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    Re: Low level Keyboard hook and keyboard synthesizes

    is the question vague?

  3. #3
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Low level Keyboard hook and keyboard synthesizes

    you need to generate the upkey events yourself via the keybd_event call.
    if you only generate down keys, you're only going to see injected down keys as well.


    See the dwFlags member in keybd_event() (http://msdn.microsoft.com/en-us/library/aa928103.aspx)

  4. #4
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    Re: Low level Keyboard hook and keyboard synthesizes

    Thanks for the reply

    The up key event is generated, but is not captured by the hooked app. only down event is captured.

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

Featured