Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Know if shift key is down
Message
De
20/04/2009 09:46:15
 
 
À
20/04/2009 09:22:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01395572
Message ID:
01395576
Vues:
115
This message has been marked as the solution to the initial question of the thread.
>Is there some way to know if the shift key is down .... when the focus is on a different form?
>
>Background: from within my PEMEditor tool, which works when using either the Form or Class Designer, I want to know when the user has held the shfit key while using the designer (presumably for selecting multiple objects).
>
>Thus, normal techniques of capturing key movements or mouse movements are irrelevant, since these events are not occurring on my form.
>
>Thanks in advance.
&& do at startup
declare short GetKeyState in User32 integer vKey

* Left SHIFT key
#define VK_LSHIFT (0xA0)

* Right SHIFT key
#define VK_RSHIFT (0xA1)


#define	VK_LSHIFT_DOWN		bittest(GetKeyState(VK_LSHIFT), 31)
#define	VK_RSHIFT_DOWN		bittest(GetKeyState(VK_RSHIFT), 31)


if( VK_LSHIFT_DOWN or VK_RSHIFT_DOWN )
   && yes
endif
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform