This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 General Discussion
 General Discussion
 Emulate mouse click in a current coordinates

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
poweruser84 Posted - 06/20/2013 : 09:10:55
Hi all

Please help me to customize StrokesPlus.
I want to emulate mouse click in a current coordinates (where is cursor's position). How i can do that?
7   L A T E S T    R E P L I E S    (Newest First)
HeavenElite Posted - 03/17/2020 : 02:00:19
quote:
Originally posted by Rob

Without knowing more details, it's difficult to give you precise assistance, but here is an example of sending a right mouse click to the current cursor location:

acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 0, 1, 1)



Thank you Very much, Mr. Rob
I'm new for StrokesPlus and modified it to
acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 2, 1, 1)

Then added this script before each acSendKeys lines.
So, no matter the text box in a web page or address bar is enabled or not, Shortcuts will be sent to the Tab or Window successfully

However, my personal settings can't be exported & imported to the latest S+ version.
And, I'm about to prepare half a day for this transfer.
poweruser84 Posted - 06/20/2013 : 14:49:32
Very useful. Thank you Rob!
Rob Posted - 06/20/2013 : 11:25:16
This will attempt to activate the window under the cursor:

acActivateWindow(acGetWindowByPoint(acGetMouseLocationX(), acGetMouseLocationY()),0,0)

Note that the term "window" means "control" really. For example, a text box is techincally a "window", meaning it has its own window handle. acGetWindowByPoint would get the handle of the text box itself (in this example).

This:

acActivateWindow(acGetParentWindowByPoint(acGetMouseLocationX(), acGetMouseLocationY()),0,0)

Will get the parent of the text box (recursively calling acGetPArentWindowByPoint, passing in the last handle, will continually walk up the window ownership hierarchy until reaching the very top).

This:

acActivateWindow(acGetOwnerWindowByPoint(acGetMouseLocationX(), acGetMouseLocationY()),0,0)

Will get the owner of the window (control), usually the owner will be the top-level (main application window).

So, it can sometimes be tricky to ensure you're getting the right window, but start with some of these and see if you have any luck.

poweruser84 Posted - 06/20/2013 : 11:13:44
Rob, you right. I need to activate the window and then perform an action.

Can you provide example of script for activation of child (or parent) window which is under mouse cursor?
Rob Posted - 06/20/2013 : 10:48:55
What video player are you using? Sending a mouse click while you're still holding the stroke mouse button will likely cause you to have problems as it creates a confusing state for Windows, S+, and its state management (discerning between a sent key, still knowing that you're holding the stroke button, etc.)

It sounds like you simply need to activate the window, which should be easy enough to accomplish. However, each program can be a little different, so knowing what software you're attempting to work with will help.
poweruser84 Posted - 06/20/2013 : 10:22:17

Thank you, Rob, for the quick assistance you have provided. Thank you for great software. I am looking forward with the StrokesPlus.

I want to configure wheel scrolls in the video player's child window.
Based on my idea, pressing the "Stroke button" with Scroll down and Scroll up over the video player's child window should:
- emulate left mouse click (to activate window under cursor, in a case when it's not in active state)
- emulate RIGHT and LEFT keyboard buttons within the child window (player's window "Overview of scenes", i am using it for switching between episodes) to perform necessary actions

I have configured new application rule for video player's child window and enabled "Do not process Global Action for this app, only app actions". It works pretty well in a such configuration:

Mouse modifiers: Scroll up
Modifier check: After Stroke button down
Lua script:
acSendKeys("{LEFT}")


Mouse modifiers: Scroll down
Modifier check: After Stroke button down
Lua script:
acSendKeys("{RIGHT}")


But when i have added command to emulate left mouse click:
acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 2, 1, 1) (as a first line in app's lua script) it doesn't work anymore. "Overview of scenes" window closing when i am trying to perform StrokesPlus's action.

Is there way to emulate left mouse click (or activate window under cursor) using scroll down and scroll up modifiers?

P.S.: Also i have Global Action and Global lua script binded to scroll down/up for fast switching of windows (it based on your Win_button+Tab (Windows aero) switching solution). I tried to disable these action/scripts but that didn't help at all.
Rob Posted - 06/20/2013 : 09:25:47
Without knowing more details, it's difficult to give you precise assistance, but here is an example of sending a right mouse click to the current cursor location:

acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 0, 1, 1)

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000