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

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

 All Forums
 General Discussion
 General Discussion
 Combining 5 scripts with one gesture
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

control_freak

51 Posts

Posted - 05/25/2016 :  18:30:45  Show Profile  Reply with Quote
Here is a way to put 5 scripts with one gesture for left, right, up, down command. to fire command you have to draw a short gesture to right, left, up or down which is less than 200 pixels, for another draw a gesture draw more than 200 pixels, draw another one from the corner or within 50 pixels of the screen, for next one you'll have to draw towards the screen and for the last one u have to start drawing gesture within 50 pixels of the screen to the end of the screen. hope my explanation is clear enough.

LEFT




local short_len=200 --better be specified in global script
local hScreen = acGetMonitorFromPoint(gsx, gsy) 

if 50 - acGetMonitorLeft(hScreen, 1) > gex then 
	-- ^^ this would be true only if the gesture ends within 50 pixels 
	-- of the left-most coordinate of the monitor where the gesture
	-- drawing began 
	if gsx-gex < short_len then 
		-- ^^ only true if the distance of the x plane (right to left)
		-- of the drawing is less than 200 pixels. If you had a 
		-- more vertical gesture, this may never be true
		--(1)
		acActivateWindow(acGetOwnerWindowByPoint(gsx, gsy),0,0)
		acMessageBox("do something1",'message',nil)
	else 
		--(2)
		acMessageBox("do something1",'message',nil)
	end 
elseif 1800 - acGetMonitorLeft(hScreen, 1) < gsx then--you might have to change 1800 and choose a suitable number for your screen 
--(3)
acMessageBox("do something1",'message',nil)

else --If the gesture didn't end within 50 pixels of the monitor's left edge or the elseif above
	if gsx-gex < short_len then 
		-- ^^ only true if the distance of the x plane (right to left)
		-- of the drawing is less than 200 pixels. If you had a 
		-- more vertical gesture, this may never be true
		--(4)
		acMessageBox("do something1",'message',nil)
	else 
		--(5)
		acMessageBox("do something1",'message',nil)
	end 
end


RIGHT




local short_len=200 --better be specified in global script
local hScreen = acGetMonitorFromPoint(gsx, gsy) 

if acGetMonitorRight(hScreen, 1) - gex < 50 then 
	-- ^^ this would be true only if the gesture ends within 50 pixels 
	-- of the right-most coordinate of the monitor where the gesture
	-- drawing began 
	if gex-gsx < short_len then 
		-- ^^ only true if the distance of the x plane (left to right)
		-- of the drawing is less than 200 pixels. If you had a 
		-- more vertical gesture, this may never be true
		--(1)
		acActivateWindow(acGetOwnerWindowByPoint(gsx, gsy),0,0)
		acMessageBox("do something1",'message',nil)
	else 
		--(2)
		acMessageBox("do something1",'message',nil)
elseif acGetMonitorRight(hScreen, 1) -1800 > gsx then
		--(3)	
		acMessageBox("do something1",'message',nil)
else --If the gesture didn't end within 50 pixels of the monitor's right edge or the elseif above
	if gex-gsx < short_len then 
		-- ^^ only true if the distance of the x plane (left to right)
		-- of the drawing is less than 200 pixels. If you had a 
		-- more vertical gesture, this may never be true
		--(4)
		acMessageBox("do something1",'message',nil)
	else 
		--(5)
		acMessageBox("do something1",'message',nil)
	end 
end


UP




local short_len=200 --better be specified in global script
local hScreen = acGetMonitorFromPoint(gsx, gsy) 

if 50 - acGetMonitorTop(hScreen, 1) > gey then 
	
	if gsy-gey < short_len then 
		
		--(1)
		acMessageBox("do something1",'message',nil)
		--(2)
		acMessageBox("do something1",'message',nil)

elseif 1000 - acGetMonitorTop(hScreen, 1) < gsy then
		--(3)	
		acMessageBox("do something1",'message',nil)
else 
	if gsy-gey < short_len then 
		
		--(4)
		acMessageBox("do something1",'message',nil)
	else 
		--(5)
		acMessageBox("do something1",'message',nil)
	end 
end


DOWN




local short_len=200 --better be specified in global script
local hScreen = acGetMonitorFromPoint(gsx, gsy) 

if acGetMonitorBottom(hScreen, 1) - gey < 50 then 
	
	if gey-gsy < short_len then 
		
		--(1)
		acMessageBox("do something1",'message',nil)
	else 
		--(2)
		acMessageBox("do something1",'message',nil)
elseif acGetMonitorBottom(hScreen, 1) - 1000 > gsy then
		--(3)	
		acMessageBox("do something1",'message',nil)
else 
	if gey-gsy < short_len then 
		
		--(4)
		acMessageBox("do something1",'message',nil)
	else 
		--(5)
		acMessageBox("do something1",'message',nil)
	end 
end

Edited by - control_freak on 05/25/2016 18:36:10
  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