🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1119

How can keyboard know that the key "Shift + Right Arrow"are pressed as the same time?

#1119
From: Emmanuel
Date: Wed, 24 Oct 2007 06:12
33 lines
1985 bytes
Dear All,
I meet a problem again
I want to make a effect to control the keyboard input
press SHIFT, and press Right Arrow
for example to select a text
by the code
 step 1: keybd_event(VK_SHIFT, 0, 0,0);
 step 2: keybd_event(39, 0, 0,0);
 step 3: keybd_event(39, 0, KEYEVENTF_KEYUP,0);
 step 4: keybd_event(39, 0, 0,0);
 step 5: keybd_event(39, 0, KEYEVENTF_KEYUP,0);
 step 6: keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP,0);

but I find that when process step 2,
the application auto recieve a keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP,0); 
signal,
such that the step 1 is useless,

 step 1: keybd_event(VK_SHIFT, 0, 0,0);
         keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP,0);
 step 2: keybd_event(39, 0, 0,0);
 step 3: keybd_event(39, 0, KEYEVENTF_KEYUP,0);
 step 4: keybd_event(39, 0, 0,0);
 step 5: keybd_event(39, 0, KEYEVENTF_KEYUP,0);
 step 6: keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP,0);

How can I send a message to the keyboard
 keybd_event(VK_SHIFT, 0, 0,0);
 keybd_event(39, 0, 0,0);
 such that the keyboard know that the key "Shift + Right Arrow" are pressed 
as the same time?

Thank
Technical Details
Message-ID: <471ee221$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ef6263e7ebba8223,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Emmanuel" <emmanuel@erphk.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How can keyboard know that the key "Shift + Right Arrow"are pressed as the same time?
Date: Wed, 24 Oct 2007 14:12:54 +0800
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
NNTP-Posting-Host: 61.141.173.149
Message-ID: <471ee221$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1193206305 61.141.173.149 (23 Oct 2007 23:11:45 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail