(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
05-18-24 02:30 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Windows keyboard hook; how to get true numpad status? New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6298 days
Last view: 6298 days
Posted on 07-20-06 06:06 PM Link | Quote
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?
sloat



 





Since: 11-18-05
From: Delaware, US

Last post: 6401 days
Last view: 6401 days
Posted on 07-21-06 12:54 PM Link | Quote
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

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6298 days
Last view: 6298 days
Posted on 07-21-06 04:11 PM Link | Quote
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.
MisterJones

Tooky








Since: 12-08-05
From: Mexico

Last post: 6388 days
Last view: 6324 days
Posted on 07-21-06 06:15 PM Link | Quote
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.
sloat



 





Since: 11-18-05
From: Delaware, US

Last post: 6401 days
Last view: 6401 days
Posted on 07-21-06 07:43 PM Link | Quote
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.
wboy









Since: 01-05-06

Last post: 6481 days
Last view: 6481 days
Posted on 07-21-06 10:42 PM Link | Quote
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.


(edited by wboy on 07-21-06 09:43 PM)
(edited by wboy on 07-21-06 09:56 PM)
Add to favorites | Next newer thread | Next older thread
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.007 seconds; used 368.33 kB (max 451.83 kB)