Determinar si la tecla SHIFT, CONTROL o ALT están presionadas
Visual Fox Pro, Trucos Comentarios ( 0 ) »#Define
VK_SHIFT 0x10
#Define
VK_CONTROL 0x11
#Define
VK_MENU 0x12
#Define
PRESSED 0x07
Declare Integer GetKeyboardState In WIN32API String @
Do While .T.
m1 = Replicate(Chr(0),255)
Wait Window
""
Timeout
0.5
GetKeyboardState(@m1)
? "Shift",
Bittest(Asc(Substr(m1,VK_SHIFT+1,1)),PRESSED)
? "Control",
Bittest(Asc(Substr(m1,VK_CONTROL+1,1)),PRESSED)
? "Alt",
Bittest(Asc(Substr(m1,VK_MENU+1,1)),PRESSED)
If Lastkey()
== 27
Exit
EndIf
EndDo
Por: David Amador T