Send mouse click on current position

My goal is to send a left mouse click when I press F2, the cursor should keep the position (to help with a disability)

Using the Click activity puts the cursor at position 0, 0

I tried using VB code to capture the position
“Dim pos As Point = System.Windows.Forms.Cursor.Position”

But I get error “Invoke code: No compiled code to run
error BC30456: ‘Cursor’ is not a member of ‘Forms’. At line 1”

System.Windows.Forms is in my namespace

Hi @fabian.jakobsson,

Check this
test.xaml (4.7 KB)

1 Like

It works :slight_smile:

Solution:

Use Assign to store System.Windows.Forms.Cursor.Position in a variable “mousePos”.
Use Click, set offsetX to mousePos.X and offsetY to mousePos.Y

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.