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

 All Forums
 Lua Scripts
 General Action Scripts
 Different Actions Based on Mouse Location
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ivancarv.spk333

38 Posts

Posted - 03/03/2013 :  17:57:23  Show Profile  Reply with Quote

Rob

USA
2516 Posts

Posted - 03/04/2013 :  00:03:00  Show Profile  Visit Rob's Homepage  Reply with Quote
Do you mean defining a gesture, just like you would right now (for example, stroke button down and scroll mouse wheel), but it does different things depending on where the mouse cursor is located?

That's something which can be done already, by calling acGetMouseLocationX() and acGetMouseLocationY(), then firing a different set of Lua script based on how you want it to happen based on the mouse location. Perhaps also using the monitor action functions like acGetMonitorRight, etc. to determine the size of the screen, etc.

Unfortunately, while you clearly put a great deal of effort into making the diagram, I'm afraid it's not conveying certain specifics to me so I can fully answer. For example, what do the red arrows indicate? The location of the mouse? A sequence in more than one mouse wheel event?

Maybe give me a couple very specific examples of where the mouse is, what the action definition is, what you'd like to happen while you're pressing which mouse button/wheel direction.

For the red arrows to right, are you suggesting that if you draw the gesture from the center to the right but not to the edge of the screen, to navigate Next; but if you draw all the way to the right edge of the screen, it plays the next song? If so, that can be accomplished by getting the mouse and screen coordinates. I'd be happy to get you started in the right direction, but I want to first make sure of exactly what you're looking to accomplish.
Go to Top of Page

ivancarv.spk333

38 Posts

Posted - 03/04/2013 :  10:58:01  Show Profile  Reply with Quote
Yes, that's exactly the way that you understand.

Something I forgot to emphasize the function of the 'Scroll' on the edge or corner of the screen) is without the need to use the right mouse button, just drag the cursor and move the scroll (comfort issue), I think I will not have conflicts anywhere ... is possible? could pass the codes of my examples?

Edited by - ivancarv.spk333 on 03/04/2013 11:02:04
Go to Top of Page

Rob

USA
2516 Posts

Posted - 03/04/2013 :  12:30:21  Show Profile  Visit Rob's Homepage  Reply with Quote
The stroke button must be pressed for S+ to take any action. The entire program is built around waiting for a key or button to be pressed and there's no simple method for adding the ability to scroll anywhere and have things happen. I will keep that request in mind for the future.

Regarding the other part of your request, I will try to put together some scripts later or perhaps tomorrow. Although, there are other forum members who have posted scripts with similar functionality. For example:

http://www.strokesplus.com/forum/topic/605/fire-actions-based-on-stroke-length
http://www.strokesplus.com/forum/topic/478/conditional-action-script
http://www.strokesplus.com/forum/topic/496/dyk-running-different-scripts-by-a-single-gesture
Go to Top of Page

ivancarv.spk333

38 Posts

Posted - 03/04/2013 :  16:20:03  Show Profile  Reply with Quote
Ok, thank you.

I have some more tips or questions, it is possible that I can use the ''scroll function on the edge of the screen'' to switch between forms display in Explorer (thumbnails, list, icons, Details, Tiles) and also switch forms of Organisation (By Name, Type, Date etc. ..)

Another, Can I Hold down Ctrl'''' down using the mouse? an ex.: to select files ...
Go to Top of Page

Rob

USA
2516 Posts

Posted - 03/05/2013 :  15:44:19  Show Profile  Visit Rob's Homepage  Reply with Quote
quote:
Originally posted by ivancarv.spk333Another, Can I Hold down Ctrl'''' down using the mouse? an ex.: to select files ...



You can try playing with acSendControlDown(), then calling acSendControlUp() when you're done...but the Control up key event doesn't seem to be recognized when it's called again, from a different action thread.

You could probably get creative in a Lua script in a long running action which keeps checking something like mouse movement, and if the mouse is stationary for XX seconds, release the control key.

I've been really busy, so I still haven't been able to get back to your first request.
Go to Top of Page

Rob

USA
2516 Posts

Posted - 03/06/2013 :  21:26:11  Show Profile  Visit Rob's Homepage  Reply with Quote
For the Right gesture:
local hScreen = acGetMonitorFromPoint(gsx, gsy) 
if acGetMonitorRight(hScreen, 1) - gex < 4 then --allow for up to 3 pixels from the edge
	acSendKeys("{MEDIANEXTTRACK}")
else
	acSendKeys("{BROWSERFORWARD}")
end


Left gesture:
local hScreen = acGetMonitorFromPoint(gsx, gsy) 
if gex - acGetMonitorLeft(hScreen, 1) < 4 then --allow for up to 3 pixels from the edge
	acSendKeys("{MEDIAPREVTRACK}")
else
	acSendKeys("{BROWSERBACK}")
end


For the Down gesture:
local hScreen = acGetMonitorFromPoint(gsx, gsy) 
if acGetMonitorBottom(hScreen, 0) - gey < 4 then --allow for up to 3 pixels from the edge
	acSendKeys("@d")
else
	acMinimizeWindow(nil, gsx, gsy)
end

I will come back to answer the wheel ones, but note that they will involve holding the stroke button, not simply rolling while the mouse wheel is at an edge.
Go to Top of Page

Rob

USA
2516 Posts

Posted - 03/06/2013 :  21:27:24  Show Profile  Visit Rob's Homepage  Reply with Quote
Note that I made the above gestures based on a standard setup, with a single monitor where the Task Bar is docked at the bottom. For other configurations, you may need some tweaks.
Go to Top of Page

ivancarv.spk333

38 Posts

Posted - 03/14/2013 :  23:40:34  Show Profile  Reply with Quote


I am very very very grateful

just when I start working, I intend to make my first donation to a software.


as the question of that function (scroll) without using the right mouse button ..
  you find on program ''volumemouse 2'', see what it's worth, is very comfortable
Go to Top of Page

ivancarv.spk333

38 Posts

Posted - 03/15/2013 :  03:20:49  Show Profile  Reply with Quote
could send me the code of (play / pause) on make a gesture to top of the monitor? tried here but from an error.
Go to Top of Page

Rob

USA
2516 Posts

Posted - 03/15/2013 :  09:02:54  Show Profile  Visit Rob's Homepage  Reply with Quote
This should work for drawing to top of screen:
local hScreen = acGetMonitorFromPoint(gsx, gsy) 
if gey - acGetMonitorTop(hScreen, 0) < 4 then --allow for up to 3 pixels from the edge
	acSendKeys("{MEDIAPLAYPAUSE}")
else
	acMessageBox("Gesture was not drawn all the way to top of screen.","What Now?", nil)
end

Not sure what you want to happen if you don't draw all the way to top, so I put a message box there..just replace it with your desired script.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000