Jump to content

about mouse click button.


Recommended Posts

i dont understand

please specify in english what your native language is, then ask the question in that language, then i will try to copy and paste that into a translator on some website.

otherwise, you will have to be more specific.

please state exactly what you are trying to do.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

Oh Sorry, I come from China, I do not understand English.

If _IsPressed('01') Then
; your code
EndIf

Func _IsPressed($HexKey)
   Local $AR
   $HexKey = '0x' & $HexKey
   $AR = DllCall("user32","int","GetAsyncKeyState","int",$HexKey)
   If NOT @Error And BitAND($AR[0],0x8000) = 0x8000 Then Return 1
   Return 0
EndFunc


#cs
  01 Left mouse button
  02 Right mouse button;does not works in my system...
  04 Middle mouse button (three-button mouse)
  05 Windows 2000/XP: X1 mouse button
  06 Windows 2000/XP: X2 mouse button

This section of code only can judge the mouse to press down, could not judge me to select any button.

Link to comment
Share on other sites

if you look under #cs

you can see what to add for the different buttons.

If _IsPressed('01') Then;left button
; your code
EndIf

If _IsPressed('02') Then;right button
; your code
EndIf

If _IsPressed('03') Then;middle button
; your code
EndIf

;...........

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

$var = inputbox("test","enter 1 to click left")

if $var = 1 then
mouseclick("left")
endif

im not sure how to click the other buttons.

but that will give you an idea of how to get user input and use it.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

您明白我吗? 如果如此取乐回复在适当的标点和拼写您的问题用中文或英语。谢谢。

您明白我嗎? 如果如此取樂回復在適當的標點和拼寫您的問題用中文或英語。謝謝。

qq

Link to comment
Share on other sites

您明白我吗? 如果如此取乐回复在适当的标点和拼写您的问题用中文或英语。谢谢。

您明白我嗎? 如果如此取樂回復在適當的標點和拼寫您的問題用中文或英語。謝謝。

<{POST_SNAPBACK}>

i could not have said it better myself.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

oh no~

哦不。

i am so sorry...

我很抱歉

I depend upon the translation software.

我是依靠翻译软件

The expression is not clear I the meaning.

没有表达出我的意思

i need Increase the new function in may the execution file.

我需要添加一个新的功能到我的程序里

Whether or not uses AUTOIT to realize?

不知道AUTOIT是否可以实现

Opens a program.打开一个程序

// Run("mstsc.exe")

I click on a button, carries out an instruction. 我点了一个按钮实现了一个功能。

//ControlClick("Remote Desktop Connection", "Co&nnect", "Button1")

the commond is bud 上面的这个语句是错误的

//MsgBox(0, "okay", "you a connect...")

I click on another button, carries out another instruction.我点了另一个按钮实现了另一个功能。

//ControlClick("Remote Desktop Connection", "Cancel", "Button2")

//MsgBox(0, "oh noo", "you a cancel...")

help me~~~

帮助我

i need..

我需要

i click the connect button

我点了这个连接按钮

popup a new windows msg "you a connect"

然后弹出新的信息窗口你已经连接

i need help...........

我需要帮助

The key point is, how judged the mouse punctuation what button? ? ?

重点是怎么判断我的鼠标点了一下按钮

Edited by kiii
Link to comment
Share on other sites

my code is error...

help me~

Run("mstsc.exe")
WinActivate("Remote Desktop Connection")

Global $KS_DOWN = -32767

While 1
  $a = KeyState(1)
  If $a = $KS_DOWN Then
  b1()
  EndIf
  Sleep(10)
WEnd

Func KeyState($hexKey)
 Local $aR
 $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
 If Not @error Then Return $aR[0]
 Return 0
EndFunc

Func b1()
$mgp = MouseGetPos ()
$b1 = ControlGetPos("Remote Desktop Connection","Co&nnect",1)
If ($mgp[0]> $b1[0]) and ($mgp[0]< $b1[0]+$b1[2]) and ($mgp[1]> $b1[1]) and ($mgp[1]< $b1[1]+$b1[38]) Then
MsgBox(0, "connect", "test connect")
EndIf
EndFunc
Link to comment
Share on other sites

  • 2 weeks later...

Run("mstsc.exe")
WinActivate("Remote Desktop Connection")

Global $KS_DOWN = -32767

While 1
  $a = KeyState(1)
  If $a = $KS_DOWN Then
  b1()
  EndIf
  Sleep(10)
WEnd

Func KeyState($hexKey)
Local $aR
$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
If Not @error Then Return $aR[0]
Return 0
EndFunc

Func b1()
$mgp = MouseGetPos ()
$b1 = ControlGetPos("Remote Desktop Connection","Co&nnect",1)
If ($mgp[0]> $b1[0]) and ($mgp[0]< $b1[0]+$b1[2]) and ($mgp[1]> $b1[1]) and ($mgp[1]< $b1[1]+$b1[38]) Then
MsgBox(0, "connect", "test connect")
EndIf
EndFunc

this code error~

help me~

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...