(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
06-15-24 09:26 PM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Windows keyboard hook; how to get true numpad status?
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
wboy
Posts: 13/15
Take a look at:
http://geocities.com/adamruggles/downloads/HookSample.zip

The example itself is in VB6 (references a custom hook dll), but it does include the hook source with it which is written in C++.

Quick test of the apps shows it does return {Shift}{Num 0} and not {Insert} so it should allow you to work out how its being done.
sloat
Posts: 17/20
Originally posted by HyperMackerel
That's not what I meant. When my keyboard hook is called it's being told that Insert is pressed. I want it to still be told that Num0 is pressed.


My mistake. I was just inspecting it and it seems bit 24 of the lParam will be set if you're using the regular insert key and cleared if you do shift+numpad0. But it still registers as an insert keystroke.
MisterJones
Posts: 54/125
Originally posted by HyperMackerel
That's not what I meant. When my keyboard hook is called it's being told that Insert is pressed. I want it to still be told that Num0 is pressed.


How about a trick checking if shift is being pressed. You can check modifiers, can't you? I'ts been a while since I have done anything win32.
HyperHacker
Posts: 2647/5072
That's not what I meant. When my keyboard hook is called it's being told that Insert is pressed. I want it to still be told that Num0 is pressed.
sloat
Posts: 16/20
From what I can remember, they Keyboard Hook can't be used to modify input. The only way I was ever able to modify keyboard data or block the keystroke message was with a WH_GETMESSAGE hook.
HyperHacker
Posts: 2640/5072
I set up a keyboard hook to detect when keys are pressed, but Windows isn't reporting the exact status of the keys. If I press Shift+Numpad 0, it reports it as being Insert that's pressed. Can I make it still report Numpad 0 somehow?
Acmlm's Board - I3 Archive - Programming - Windows keyboard hook; how to get true numpad status?


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.011 seconds; used 349.54 kB (max 396.10 kB)