This App is No Longer Maintained. Visit the Replacement at

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

 All Forums
 General Discussion
 General Discussion
 Mousewheel: How to execute only one action
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  


1 Posts

Posted - 04/20/2016 :  22:16:50  Show Profile  Reply with Quote
I mapped RightMouseButton + ScroolWheelUp to an action which sends a Windows key to open the start menu. Problem is that if multiple wheel ticks are executed, this will send multiple Windows keys.

Is there a way to execute only one action until the RightMouseButton is lifted?



2606 Posts

Posted - 04/20/2016 :  22:50:45  Show Profile  Visit Rob's Homepage  Reply with Quote
There's probably a few ways to do it, but the immediate one that comes to mind is enabling Allow After Release Script*. Then, in your action do something like:
if bWinDown == nil or bWinDown == 0 then
	bWinDown = 1
Then in your Global Lua tab find (or add) this function:
function sp_after_release()
	bWinDown = 0
Unless you installed S+ a LONG time ago or cleared out your Global Lua, the sp_after_release() function should already be there, if so just add the bWinDown = 0 code.
So the first time it executes, it sends the Windows key and sets bWinDown to 1 so the next tick won't send it again until you release the stroke button which sets bWinDown back to 0.

Though, keep in mind that there are 2 independent Lua engines in S+, and if you scroll fast enough, S+ could use the backup Lua engine, which would not be aware of the bWinDown variable, though if it happened, it would likely only affect you the first time.
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