|
-
May 27th, 1999, 01:51 PM
#1
How do I capture keystrokes at the Windows level? In MFC?
I want to get system-level control of keystrokes and mouse position. I would prefer to use MFC because I am not proficient in C++ at the system level. Any source of sample code would be appreciated also.
I apoligize in advance because I am SURE that the above question has been asked in the past. I just can't find the answer!
Thanks.
Larry Woods
l.woods, inc.
Scottsdale, Arizona
-
May 27th, 1999, 02:40 PM
#2
Re: How do I capture keystrokes at the Windows level? In MFC?
Have you tried mapping WM_KEYDOWN (occurs with any key presses) or WM_CHAR (only occurs on character keys)?
-
May 27th, 1999, 03:44 PM
#3
Re: How do I capture keystrokes at the Windows level? In MFC?
This will only give me control for keystrokes from my thread, I believe. I want to interrogate ALL keystrokes from ALL windows.
Isn't this true?
Larry Woods
l.woods, inc.
Scottsdale, Arizona
-
May 28th, 1999, 02:53 AM
#4
Re: How do I capture keystrokes at the Windows level? In MFC?
-
May 29th, 1999, 11:58 AM
#5
Re: How do I capture keystrokes at the Windows level? In MFC?
I'm not sure if you are looking for these but I understood you needed the name of functions that deal with keystrokes and mouse positions. I apologize if this is not what you want.
You have OnChar() OnKepUp() and OnKeyDown() member funtions of class CWnd. They activate on response to keystrokes. OnKeyDown() activates on response to keystrokes in keys like DEL even.
Then you have OnSysChar() , OnSysKeyUp() and OnSysKeyDown() for system keys and combination of ALT+key.
Remember that only the active window will receive messages on response to these events.
To catch mouse position remember you have OnLButtonDown() OnLButtonUp() OnRButtonDown() OnLRuttonUp() OnMouseMove() and more.
Xexi
"Life's a journey, not a destination"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|