|
-
August 9th, 2011, 09:26 AM
#16
Re: C++ problem with sending keystrokes
 Originally Posted by Doomy
keybd_event(0x25, 0, 0, 0);
keybd_event(0x25, 0, KEYEVENTF_KEYUP, 0);
there, does that help in any way? i doubt it.
Sure it helps.
At least it shows that you are NOT sending '%'. According to MSDN:
VK_LEFT 0x25 LEFT ARROW key
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
August 9th, 2011, 09:42 AM
#17
Re: C++ problem with sending keystrokes
Good catch, Vlad!
Victor Nijegorodov
-
August 9th, 2011, 09:50 AM
#18
Re: C++ problem with sending keystrokes
 Originally Posted by Doomy
keybd_event(0x25, 0, 0, 0);
keybd_event(0x25, 0, KEYEVENTF_KEYUP, 0);
there, does that help in any way?
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
Where do you see in the documentation above that 0x25 is the "%" key? The virtual key code you're sending is the left-arrow. So your program behaves exactly as expected.
Secondly, the "%" is a shifted-5 key. So how are you sending the shift-key? I have never used keybd_event, but as you can see, you need to distinguish between a shifted key and non-shifted key.
A bit of advice -- too many times, people believe their code is either not relevant to the problem, or think that their code is OK. Then what winds up happening is that when the code is posted late in the game, we see that the code was not correct. We could have saved a lot of time if you had posted the erroneous code much earlier, preferably in your first post.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; August 9th, 2011 at 09:55 AM.
Tags for this Thread
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
|