Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Программирование [игнор отключен] [закрыт для гостей] / Симуляция в AutoIt 3 / 5 сообщений из 5, страница 1 из 1
30.11.2010, 21:43:19
    #36987370
LexaSF
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Симуляция в AutoIt 3
Как симулировать нажатие левой кнопки мыши на указанных координатах в автоите?
...
Рейтинг: 0 / 0
01.12.2010, 05:52:50
    #36987718
AndreTM
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Симуляция в AutoIt 3
Код: plaintext
MouseClick("left", Xcoordinate, Ycoordinate,  1 ,  0 )
MouseClick

Perform a mouse click operation.


MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

Parameters

button The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".
x, y [optional] The x/y coordinates to move the mouse to. If no x and y coords are given, the current position is used (default).
clicks [optional] The number of times to click the mouse. Default is 1.
speed [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10.

Return Value

Success: Returns 1.
Failure: Returns 0, the button is not in the list or invalid parameter as x without y.



Remarks

If the button is an empty string, the left button will be clicked.
If x or y equal to the Default keyword no move occurs in the corresponding coordinate.

If the user has swapped the left and right mouse buttons in the control panel, then the behaviour of the buttons is different. "Left" and "right" always click those buttons, whether the buttons are swapped or not. The "primary" or "main" button will be the main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not.


Button Normal Swapped
"" Left Left
"left" Left Left
"middle" Middle Middle
"right" Right Right
"primary" Left Right
"main" Left Right
"secondary" Right Left
"menu" Right Left




Related

MouseClickDrag, MouseGetPos, MouseMove, MouseCoordMode (Option), MouseClickDelay (Option), ControlClick, MouseDown, MouseUp, MouseWheel


Example


; Double click at the current mouse pos
MouseClick("left")
MouseClick("left")

; Double click at 0,500
MouseClick("left", 0, 500, 2)


; SAFER VERSION of Double click at 0,500 - takes into account user's control panel settings
MouseClick("primary", 0, 500, 2)
...
Рейтинг: 0 / 0
01.12.2010, 12:33:57
    #36988374
LexaSF
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Симуляция в AutoIt 3
Именно симулировать, чтобы мышка не передвигалась
...
Рейтинг: 0 / 0
01.12.2010, 19:37:38
    #36989909
AndreTM
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Симуляция в AutoIt 3
Хелп читать некогда?
Код: plaintext
1.
2.
$pos = MouseGetPos()
MouseClick("primary", Xcoordinate, Ycoordinate,  1 ,  0 )
MouseMove($pos[ 0 ], $pos[ 1 ],  0 )
Кроме того, зачем дергать или "эмулировать" мышь?
Если известен контрол, который нужно кликнуть - так и используйте ControlClick()
...
Рейтинг: 0 / 0
01.12.2010, 22:05:42
    #36990125
LexaSF
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Симуляция в AutoIt 3
AndreTMХелп читать некогда?
Код: plaintext
1.
2.
$pos = MouseGetPos()
MouseClick("primary", Xcoordinate, Ycoordinate,  1 ,  0 )
MouseMove($pos[ 0 ], $pos[ 1 ],  0 )
Кроме того, зачем дергать или "эмулировать" мышь?
Если известен контрол, который нужно кликнуть - так и используйте ControlClick()
В том то и дело, что не известен
...
Рейтинг: 0 / 0
Форумы / Программирование [игнор отключен] [закрыт для гостей] / Симуляция в AutoIt 3 / 5 сообщений из 5, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]