c++ - Returning variables from complex function to use in another -
i'm confused, how can use getcursorpos
getpoint()
point in clicksimulationmove , use exact point in mousereturn
in clicksimulationclick
. sadly can't stick click , move functions together.
the code:
fb::variant testpluginapi::clicksimulationclick() { point pt = getpoint(); showcursor(true); mouseleft(); mousereturn(pt.x, pt.y); showcursor(true); return 0; } point testpluginapi::getpoint() { point pt; getcursorpos(&pt); return pt; } fb::variant testpluginapi::clicksimulationmove() { mousemove(-325, 605); return 0; }
clicksimulationmove() goes first, clicksimulationclick(), therefore getpoint() gets point of moved mouse, need point of not yet moved mouse return place.
you need make note of mouse position before move it. call getcursorpos before mousemove. remember position in variable pass function restores cursor position.
Comments
Post a Comment