Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Ctrl+Shift keypress
Message
From
06/01/2009 19:21:59
 
 
To
06/01/2009 13:49:36
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01371451
Message ID:
01371545
Views:
15
From Winuser.h :

/*
* VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
* Used only as parameters to GetAsyncKeyState() and GetKeyState().
* No other API or message will distinguish left and right keys in this way.
*/
#define VK_LSHIFT 0xA0
#define VK_RSHIFT 0xA1
#

>Hi all,
>I have a form with a RichTextBox on it.
>I want to have two command button LTRCMD and RTLCMD.
>I put below code in LTRCMD Click Event:
>
>#define VK_CONTROL 0x11  && CTRL key  
>#define VK_LSHIFT  160  && Left SHIFT key  
>#define VK_RSHIFT  161  && Right SHIFT key  
>#define KEYEVENTF_KEYUP  2
>#define KEYEVENTF_EXTENDEDKEY  1 
>
>DECLARE INTEGER keybd_event IN Win32API INTEGER, INTEGER, INTEGER, INTEGER
>
>thisform.olerTF.SetFocus
>      
>keybd_event( VK_CONTROL,  0, 0 , 0 ) && ctrl key down
>keybd_event( VK_LSHIFT,    0, 0 , 0 ) && Left Shift key down
>
>keybd_event( VK_CONTROL,  0, KEYEVENTF_KEYUP, 0 ) 
>keybd_event( VK_LSHIFT,    0, KEYEVENTF_KEYUP, 0 )
>
>and below code in RTLCMD Click event :
>
>#define VK_CONTROL 0x11  && CTRL key  
>#define VK_LSHIFT  160   &&0x2A  && Left SHIFT key  
>#define VK_RSHIFT  161   &&0x36  && Right SHIFT key  
>#define KEYEVENTF_KEYUP  2
>#define KEYEVENTF_EXTENDEDKEY  1 
>
>DECLARE INTEGER keybd_event IN Win32API INTEGER, INTEGER, INTEGER, INTEGER
>
>thisform.olerTF.SetFocus
>      
>keybd_event( VK_CONTROL,  0, 0 , 0 ) && ctrl key down
>keybd_event( VK_RSHIFT,    0, 0 , 0 ) && Right Shift key down
>
>keybd_event( VK_CONTROL,  0, KEYEVENTF_KEYUP, 0 ) 
>keybd_event( VK_RSHIFT,    0, KEYEVENTF_KEYUP, 0 )
>
>when i press LTRCMD, all thing is good, but when i press RTLCMD ? NOTHING !
>where i am wrong?
>Thanks
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform