| View previous topic :: View next topic |
| Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Sep 16, 2003 4:03 pm Post subject: Last Click state |
|
|
Is there a way with API to get the last click state (what button was used)? I want to find out what button was pressed to select a menu item.
Thanks, _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Sep 16, 2003 4:10 pm Post subject: |
|
|
The GetAsyncKeyState function determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.
| Code: | SHORT GetAsyncKeyState(
int vKey // virtual-key code
); |
It is a little tricky to use. You can look at it implementing here. You need you need to reset it's state under a timer or a way to neutralize any clicks out of you desired area/control.
http://forum.vdsworld.com/viewtopic.php?t=1784 _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Tue Sep 16, 2003 5:18 pm; edited 1 time in total |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Sep 16, 2003 4:31 pm Post subject: |
|
|
Thank you very much! That's what I wanted. I really need to study the Win32 help file...it's just so big... !  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Sep 16, 2003 5:16 pm Post subject: |
|
|
If you need them:
virtual-key codes for mouse:
VK_LBUTTON = 01
VK_RBUTTON = 02
VK_MBUTTON = 04
All of these begin with VK_ you can get it from API constants reference too if U want any other key. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Tue Sep 16, 2003 5:21 pm; edited 1 time in total |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Sep 16, 2003 5:18 pm Post subject: |
|
|
Yep, I went throught the file to read up on the GetAsyncKeyState function and found all of the Virtual-Key codes. Thanks again. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
|