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

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 How to get the mouse cursor type before action?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

defpt

18 Posts

Posted - 03/05/2013 :  17:05:32  Show Profile
How to get the mouse cursor type (by gsx,gsy) before action with function sp_before_action()
I tried to write the code wieso:

function sp_before_action(gnm, gsx, gsy, gex, gey, gwd, gapp, gact)
acGetMouseCursorType()
end

but this is the cursor type by (gex,gey)


Rob

USA
2615 Posts

Posted - 03/05/2013 :  20:57:35  Show Profile  Visit Rob's Homepage
acGetMouseCursorType() returns the mouse cursor type at the time that acGetMouseCursorType() is called. S+ doesn't keep track of what the mouse cursor was at different points in time, it would be very difficult to properly manage and a waste of resources.

Alternatively, you could do something like:
acConsumePhysicalInput(1) --prevent arbitrary physical mouse movements from interrupting the process
acMouseMove(gsx, gsy) --move mouse to gesture start
acDelay(10) --allow some time for things to process
local sCursorType = acGetMouseCursorType() --get the cursor
acDelay(10)
acMouseMove(gex, gey) -- move the mouse back to where the gesture ended
acConsumePhysicalInput(0) --allow physical input again
if sCursorType == "HAND" then
    acMessageBox(sCursorType, "Cursor Was HAND", nil)
end
Go to Top of Page

defpt

18 Posts

Posted - 03/06/2013 :  12:16:54  Show Profile
Thank you very much£”
I know, that must be done through the function acMouseMove().
In fact, I just do not want to use this function, which will cause the trajectory is not smooth”­”­
Go to Top of Page

Zeph

5 Posts

Posted - 09/08/2013 :  15:58:42  Show Profile
How about a
acGetStartMouseCursorType()
or
sp_gesture_start_cursor

That will come in very handy in these kinds of situation. We can then avoid the cursor movement and the delay.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 09/08/2013 :  22:31:12  Show Profile  Visit Rob's Homepage
The problem with that is performance. It's actually pretty resource intensive (relatively speaking) to get the cursor info...and to have to do so every time the stroke button is clicked.

While I do agree it would be handy from time to time, it's not worth the performance hit that would be added for all users. Keep in mind that even if you didn't draw a gesture, simply right-clicked something, S+ doesn't know in advance what your intent is, so even those instances would require the processing to identify the cursor.

Just so you know, to identify the cursor, I have to load into memory the cursor images for all 14 standard types, then get the current cursor and compare it against all 14 types to find the match. This is why I mention the performance penalty, as it's significant and wouldn't benefit 99% of the average person's actions.
Go to Top of Page

Zeph

5 Posts

Posted - 09/09/2013 :  01:24:29  Show Profile
You are right. Too much processing involved.

Thanks for the response.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000