An_icehole Posted November 21, 2006 Posted November 21, 2006 i want to get the x and y cords when i click the left mouse button, i want to use MouseGetPos but only after the left mouse button has been clicked is this possible as i cannot seem to find a command that detects when the mouse button is pressed can anyone help please
newb_powa' Posted November 21, 2006 Posted November 21, 2006 i want to get the x and y cords when i click the left mouse button, i want to use MouseGetPos but only after the left mouse button has been clicked is this possible as i cannot seem to find a command that detects when the mouse button is pressed can anyone help pleaseread about _IsPressed in the helpfiles, I'm pretty sure it will help you ^^
xcal Posted November 21, 2006 Posted November 21, 2006 _IsPressed() How To Ask Questions The Smart Way
Outshynd Posted November 21, 2006 Posted November 21, 2006 Dim $pos While 1 If _IsPressed(0x01) Then $pos = MouseGetPos() ;do whatever with $pos[0] and $pos[1] (x and y respectively) here EndIf Sleep(25) WEnd Func _IsPressed($hexKey) Local $ret = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($ret[0], 0x8000) = 0x8000 Then Return 1 Else Return 0 EndIf EndFunc
An_icehole Posted November 21, 2006 Author Posted November 21, 2006 Well thanks guys sometimes its hard to see the wood for the trees _IsPressed works perfectly i was looking thru the command list for a mouse based command and missed _IsPressed once again thanks guys your the best
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now