Simulate input/Mouse: Difference between revisions

→‎{{header|Racket}}: New Racket solution
m (→‎{{header|Scala}}: Rm Scala imp category)
(→‎{{header|Racket}}: New Racket solution)
Line 175:
 
click()</lang>
 
=={{header|Racket}}==
{{trans|Python}}
 
Same as the Python entry: use a User32 function to simulate a mouse click.
 
<lang Racket>
#lang at-exp racket
 
(require ffi/unsafe)
 
(define mouse-event
(get-ffi-obj "mouse_event" (ffi-lib "user32")
(_fun _int32 _int32 _int32 _int32 _pointer -> _void)))
 
(mouse-event #x2 0 0 0 #f)
(mouse-event #x4 0 0 0 #f)
</lang>
 
=={{header|Scala}}==