SO I thought I would press on, perhaps adding the mouse click event would help, in case my program pulled a window to the front and it disappeared to the back to quick for the eye to see.
SO I added, just the mouse click part. I added lazmouseandkeyinput into the project inspector and added, the (simplied)
mouseinput.click (mbleft, [], 100,100);
I get an error similar to the other,
Error: Incompatible type for arg no.1: Got "Tmousebtntype, expected "Tmousebutton"
Interestingly I stripped your example to just adding the uses mouseandkeyinput and this one action and it works.
Adding just the uses and action to a fresh button on my app does not.
I assume, just as I have a unit with conflicting variable definition and type for the same type in windows get handle calls, I too have the same conflict in a unit I am using for mouse/key stuff.
I am using, classes, sysutils, fileutils, strutils, forms, controls, graphics, dialogs, stdctrls, clipbrd, windows, messages, extctrls, shellcontrls, inifiles, shellapi, filectrl, msearch
As the program has quite a few other and varied functions etc...