Anonymous user
Simulate input/Mouse: Difference between revisions
no edit summary
(Added Kotlin) |
No edit summary |
||
Line 116:
If you have a reference to the AbstractButton this is simpler:
<lang java>button.doClick(); //optionally, give an integer argument for the number of milliseconds to hold the button down</lang>
=={{header|Julia}}==
This may be done using Julia's C call FFI:
<lang julia>
# Wrap win32 API function mouse_event() from the User32 dll.
function mouse_event_wrapper(dwFlags,dx,dy,dwData,dwExtraInfo)
ccall((:mouse_event, "User32"),stdcall,Void,(UInt32,UInt32,UInt32,UInt32,UInt),dwFlags,dx,dy,dwData,dwExtraInfo)
end
function click()
mouse_event_wrapper(0x2,0,0,0,0)
mouse_event_wrapper(0x4,0,0,0,0)
end
</lang>
=={{header|Kotlin}}==
Line 133 ⟶ 149:
}
</lang>
=={{header|Oz}}==
|