f



Injected Right Shift

My application currently does keyboard injection and everything
works... except for the right shift key. I don't know why, the other
right-modifier keys all work but right shift key doesn't go through.
MapVirtualKey returns 0 when I try to map 0x36 (the scancode for right
shift) and if I manually set the wVk to VK_RSHIFT it ends up getting
changed to 0 sometime before my low level keyboard hook captures it
(the OS is removing the VK) but the scancode stays as 0x36.

I have searched everywhere for an answer but have been unable to find
anything. Does anyone know what the trick is to injecting the right
shift key? My right shift key works fine normally, I just can't inject
it for some reason.  Using a low level keyboard hook I compared the
KBDLLHOOKSTRUCT of a normal right shift key down to my injected right
shift key down and they look identical with the only difference being
the injected flag.  For some reason though, windows doesn't like my
injected right shift.  I'm at a loss and any help would be appriciated.

0
micahc
2/7/2007 8:00:15 AM
comp.os.programmer.win32 14522 articles. 0 followers. Post Follow

1 Replies
322 Views

Similar Articles

[PageSpeed] 27

Finally found something that let me work around the issue. Apparently
the key comes in from the keyboard with the LLKHF_EXTENDED flag set.
If you try to inject the key with the extended flag set though it
won't work.  Windows bug? Known issue?

On Feb 7, 12:00 am, mic...@gmail.com wrote:
> My application currently does keyboard injection and everything
> works... except for the right shift key. I don't know why, the other
> right-modifier keys all work but right shift key doesn't go through.
> MapVirtualKey returns 0 when I try to map 0x36 (the scancode for right
> shift) and if I manually set the wVk to VK_RSHIFT it ends up getting
> changed to 0 sometime before my low level keyboard hook captures it
> (the OS is removing the VK) but the scancode stays as 0x36.
>
> I have searched everywhere for an answer but have been unable to find
> anything. Does anyone know what the trick is to injecting the right
> shift key? My right shift key works fine normally, I just can't inject
> it for some reason.  Using a low level keyboard hook I compared the
> KBDLLHOOKSTRUCT of a normal right shift key down to my injected right
> shift key down and they look identical with the only difference being
> the injected flag.  For some reason though, windows doesn't like my
> injected right shift.  I'm at a loss and any help would be appriciated.

0
micahc
2/7/2007 8:09:51 AM
Reply: