all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
2
Task/Simulate-input-Mouse/0DESCRIPTION
Normal file
2
Task/Simulate-input-Mouse/0DESCRIPTION
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Simulate the click of a mouse button by the user. Specify if the target GUI may be externally created.
|
||||
{{Omit From|Modula-3}}
|
||||
4
Task/Simulate-input-Mouse/1META.yaml
Normal file
4
Task/Simulate-input-Mouse/1META.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
category:
|
||||
- Testing
|
||||
note: GUI
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
WinActivate, ahk_class MozillaUIWindowClass
|
||||
Click 200, 200 right ; relative to external window (firefox)
|
||||
sleep, 2000
|
||||
WinMinimize
|
||||
CoordMode, Mouse, Screen
|
||||
Click 400, 400 right ; relative to top left corner of the screen.
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using fwt
|
||||
using gfx
|
||||
|
||||
class Main
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
button1 := Button
|
||||
{
|
||||
text = "don't click!"
|
||||
onAction.add |Event e|
|
||||
{
|
||||
echo ("clicked by code")
|
||||
}
|
||||
}
|
||||
button2 := Button
|
||||
{
|
||||
text = "click"
|
||||
onAction.add |Event e|
|
||||
{
|
||||
// fire all the event listeners on button1
|
||||
button1.onAction.fire(e)
|
||||
}
|
||||
}
|
||||
Window
|
||||
{
|
||||
title = "simulate mouse event"
|
||||
size = Size (300, 200)
|
||||
button1,
|
||||
button2,
|
||||
}.open
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
using [java] java.awt::Robot
|
||||
using [java] java.awt.event::InputEvent
|
||||
using fwt
|
||||
using gfx
|
||||
|
||||
class Main
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
button := Button
|
||||
{
|
||||
text = "click for robot"
|
||||
onAction.add |Event e|
|
||||
{
|
||||
robot := Robot ()
|
||||
robot.mouseMove (50, 50) // move to screen point 50, 50
|
||||
robot.mousePress (InputEvent.BUTTON1_MASK) // and click mouse
|
||||
robot.mouseRelease (InputEvent.BUTTON1_MASK)
|
||||
}
|
||||
}
|
||||
Window
|
||||
{
|
||||
title = "simulate mouse event"
|
||||
size = Size (300, 200)
|
||||
button,
|
||||
}.open
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Start,Programs,Accessories,Notepad,Textbox,Type:Hello World[pling],Menu:File,Save,
|
||||
Inputbox:filename>greetings.txt,Button:Save
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Point p = component.getLocation();
|
||||
Robot robot = new Robot();
|
||||
robot.mouseMove(p.getX(), p.getY()); //you may want to move a few pixels closer to the center by adding to these values
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK); //BUTTON1_MASK is the left button,
|
||||
//BUTTON2_MASK is the middle button, BUTTON3_MASK is the right button
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
|
|
@ -0,0 +1 @@
|
|||
button.doClick(); //optionally, give an integer argument for the number of milliseconds to hold the button down
|
||||
10
Task/Simulate-input-Mouse/Oz/simulate-input-mouse.oz
Normal file
10
Task/Simulate-input-Mouse/Oz/simulate-input-mouse.oz
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
declare
|
||||
[QTk] = {Module.link ['x-oz://system/wp/QTk.ozf']}
|
||||
Button
|
||||
Window = {QTk.build td(button(text:"Click me" handle:Button))}
|
||||
in
|
||||
{Window show}
|
||||
{Delay 500}
|
||||
{Tk.send event(generate Button "<ButtonPress-1>")}
|
||||
{Delay 500}
|
||||
{Tk.send event(generate Button "<ButtonRelease-1>")}
|
||||
15
Task/Simulate-input-Mouse/PicoLisp/simulate-input-mouse.l
Normal file
15
Task/Simulate-input-Mouse/PicoLisp/simulate-input-mouse.l
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(load "@lib/http.l" "@lib/scrape.l")
|
||||
|
||||
# Connect to the demo app at http://7fach.de/8080
|
||||
(scrape "7fach.de" 80 "8080")
|
||||
|
||||
# Log in
|
||||
(expect "'admin' logged in"
|
||||
(enter 3 "admin") # Enter user name into 3rd field
|
||||
(enter 4 "admin") # Enter password into 4th field
|
||||
(press "login") ) # Press the "login" button
|
||||
|
||||
(click "Items") # Open "Items" dialog
|
||||
(click "Spare Part") # Click on "Spare Part" article
|
||||
(prinl (value 8)) # Print the price (12.50)
|
||||
(click "logout") # Log out
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Macro Click()
|
||||
mouse_event_(#MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
|
||||
mouse_event_(#MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
|
||||
EndMacro
|
||||
|
||||
; Click at the current location
|
||||
Click()
|
||||
|
||||
Delay(1000) ; Wait a second
|
||||
|
||||
; Move to a new location and click it
|
||||
SetCursorPos_(50, 50)
|
||||
Click()
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
; The same function as above, but using AutoWin UserLibray
|
||||
AW_MouseClick()
|
||||
Delay(1000)
|
||||
AW_MouseClick(#PB_MouseButton_Left, 50, 50)
|
||||
3
Task/Simulate-input-Mouse/Tcl/simulate-input-mouse-1.tcl
Normal file
3
Task/Simulate-input-Mouse/Tcl/simulate-input-mouse-1.tcl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Simulate a full click cycle: button down and up
|
||||
event generate .okBtn <ButtonPress-1> -x 5 -y 5
|
||||
event generate .okBtn <ButtonRelease-1> -x 5 -y 5
|
||||
1
Task/Simulate-input-Mouse/Tcl/simulate-input-mouse-2.tcl
Normal file
1
Task/Simulate-input-Mouse/Tcl/simulate-input-mouse-2.tcl
Normal file
|
|
@ -0,0 +1 @@
|
|||
.okBtn invoke
|
||||
Loading…
Add table
Add a link
Reference in a new issue