Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > VC++ keybd_event and VK_SHIFT problem

Reply
Thread Tools

VC++ keybd_event and VK_SHIFT problem

 
 
roshan@exeltech.com
Guest
Posts: n/a
 
      05-30-2006
All,

Hello. I am a Software Developer currently creating an emulation
program for our company's System Administrator. He will be able to
call the program and emulate any keyboard combination, or at least
that's the goal. Problem is I am having severe troubles emulating
Shift key combos like (Shift key + End) for example. Nothing happens!
Some combos work such as Shift key + h which gives 'H'. The problem is
more specifically related with emulating the highlighting of characters
which is done for copying or cutting text. The OS I am using is
Windows 2000. Just to let you view a snippet of the code I'm trying to
execute, here it is:

keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), 0, 0);
Sleep(250);
keybd_event(VK_END, MapVirtualKey(VK_END, 0), 0, 0);
Sleep(250);
keybd_event(VK_END, MapVirtualKey(VK_END, 0), KEYEVENTF_KEYUP, 0);
Sleep(250);
keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), KEYEVENTF_KEYUP,
0);
Sleep(250);

Please note I've also tried:

VK_LSHIFT instead of VK_SHIFT, but doesn't work.

VK_RSHIFT instead of VK_SHIFT. The highlighting and text copying work,
but shift key stays pressed down afterward. I have to manually hit
right shift key to release it. I shouldn't have to do this.

Please provide any help if you know the solution.

Regards,

Roshan

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      05-30-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> [...] Some combos work such as Shift key + h which gives 'H'. The problem
> is [..] VK_RSHIFT instead of VK_SHIFT. [..]
>
> Please provide any help if you know the solution.


Please post to 'comp.os.ms-windows.programmer.win32' where this is
on topic. Here it isn't.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebServer has encounted a problem and need to close out: Newbie with problem about webcontrol Eric ASP .Net 0 03-24-2006 02:20 PM
keybd_event function behaviour daniele.balducci ASP .Net Web Services 0 10-18-2005 04:23 PM
keybd_event() bradfordh@gmail.com C++ 3 01-11-2005 07:57 AM
Keypress with virtual key. (keybd_event) chella C++ 1 08-11-2004 03:25 PM
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments