forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Last Click state

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Sep 16, 2003 4:03 pm    Post subject: Last Click state Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Sep 16, 2003 4:10 pm    Post subject: Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Sep 16, 2003 4:31 pm    Post subject: Reply with quote

Thank you very much! That's what I wanted. I really need to study the Win32 help file...it's just so big... ! Smile
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Sep 16, 2003 5:16 pm    Post subject: Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Sep 16, 2003 5:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group