Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A good thing to know...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00057267
Message ID:
00057289
Views:
30
>>I don't remember who asked the question the other day, but someone wanted to know how to capture a shift-click. I thing that the problem was resolved for her, but I have come across a win32 function perfect for capturing if a key is held down at any given time; getkeystate()
>>
>>declare SHORT GetKeyState in Win32API INTEGER Key
>>
>>getkeystate(17) returns .T. if the CTRL key is being held down and
>>getkeystate(16) returns .T. if the shift key is being held down.
>>
>>I came across this usage in someone else's code, and I don't know where the 16 and 17 come from... they're not the inkey values... does anybody else know?
>
>Eric,
>
>GetKeyState doesn't return a logical value, unless, of course, you're simply evaluating the result as being NOT EMPTY(). Normally, an API function that returns a BOOL, returns either 1 or 0. In this case, the acutal value returned can have significance, depending on what bit is set.
>
>The values are what are referred to as "Virtual Key Codes". I have a listing of them in the Winuser.h include file that comes with the MSDN CDs. You can also determine which of the CTRL or shift keys are being press. However, this doesn't necessary reflect the state of the key at the interrupt level associated with the hardware.
>
>hth,
>
>George

Of course your right... I didn't post the complete usage. The way getfldstate was used was:
getkeystate(17) < 0

It returns a negative value if the key is being held. Thanks for the enlightenment...
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform