Mouse:LeftClick not working for Button UIElement

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
mistahmikey
GamingTools Subscriber
Posts: 29
Joined: Wed Jun 30, 2010 7:48 am

Mouse:LeftClick not working for Button UIElement

Post by mistahmikey » Mon Dec 03, 2012 11:40 pm

I am able to use Mouse:Position to move the cursor over a UIElement button I would like to click. However, when I execute Mouse:LeftClick (after insuring Mouse.X and Mouse.Y are at the desired location), nothing happens.

Is there a trick to this?

Thanks for any advice.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Tue Dec 04, 2012 6:47 am

Yes...

The trick is that you're using a method that sends a click directly to the game, regardless of any LavishGUI elements that happen to be where the mouse pointer is.

You would instead need to use a method on the LavishGUI element in order to do that.

mistahmikey
GamingTools Subscriber
Posts: 29
Joined: Wed Jun 30, 2010 7:48 am

Post by mistahmikey » Tue Dec 04, 2012 2:18 pm

Aha. Is there any chance you could provide a method that sends mouse clicks directly to the window that contains the cursor and/or has focus? The reason for this is I wish to automate testing of LavishGui clients. I suppose I could figure out a way to do this directly via the Windows API, but it would be much easier if I could do it directly via LavishScript.

Thanks :)

Post Reply