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
 Feature Updates
 Completed Requests
 [COMPLETE] Rocker gestures
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rob

USA
2615 Posts

Posted - 01/31/2012 :  04:22:42  Show Profile  Visit Rob's Homepage
UPDATE: Rocker support was added by utilizing the Capture Modifiers on Stroke Button Down preference. See here for details on setting up a rocker gesture:

http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=407



(question I received via email)

Can StrokePlus handle rocker gestures where the trigger is right mouse button held down and click left mouse button (or vice versa: left held right clicked). Several browsers use this (such as Opera) to move forward and back through the history, and I'd like to extend this functionality to all apps where a forward back action is appropriate.

Rob

USA
2615 Posts

Posted - 01/31/2012 :  04:26:18  Show Profile  Visit Rob's Homepage
Rocker gestures are definitely a tricky thing, considering the way S+ works. It's easy to rock one way, like holding right (if stroke button) and clicking left works perfectly fine as I have that action set for opening a link in a new window. Going the other way, however, is not as easy it one would think..given the way S+ is designed to function.

Right now, the stroke button (default right) being pressed is what tells S+ to watch for a gesture/action. Everything is driven and based off of that button being the starting point for everything from gesture recognition to what should happen if the gesture is aborted (timed out, which replays the mouse events in order to emulate what would've happened if S+ weren't running). Having the ability to essentially have more than one stroke button, which is what a rocker would be, immensely complicates everything. Each time any mouse button was pressed, S+ would have to check the window to see if it's ignored (instead of only when stroke button is pressed), maintain varying states for mouse actions, and imagine how often people tend to left-click on something and move the mouse (to drag, scroll a window, highlight text)...all of these events would be a gigantic annoyance as you would have to hold the left button down, wait for the gesture timeout, then do what you wanted to do (like dragging something with the mouse).

If it weren't for the fact that S+ is designed to recognize drawn gestures, having rocker (mouse button combinations) gestures would be easy as it wouldn't interfere with normal PC usage. Now, a program could be written in a way where it only captures the mouse on the right button and not the left, yet still recognize a left press with a right press as a gesture..but it's honestly not something I currently want to even get into as I would literally have to rewrite S+ just for that one piece of functionality; and even then it still feels very complicated, especially in how the UI would present this usage to the user..but that's not the main issue.

So in the end, rocking one way is easy and already supported, but everything must begin with the stroke button. To be honest, I use a Razer Mamba gaming mouse which has X1 and X2 buttons on the left under my thumb that I use for Back/Forward, so perhaps this thought never occurred to me when I started writing S+, however, I can say that for the foreseeable future, S+ won't be able to recognize any kind of gestures originating from a mouse button other than the selected stroke button.

I've flagged this as deferred for now as it may be something I can figure out a way to implement as an experimental (unsupported) feature..but don't hold your breath!
Go to Top of Page

Cerberus

Netherlands
86 Posts

Posted - 01/31/2012 :  14:05:19  Show Profile  Visit Cerberus's Homepage
I personally do not use rocker gestures (perhaps because I don't like having to deal with two buttons at once). But this can easily be accomplished with a small Autohotkey script:

~Rbutton Up::                     ;Whenever the right mouse button is released,
If GetKeyState("Lbutton", "P")    ;the script checks whether the left button is held down physically;
Msgbox, You just pressed the right mouse button while holding down the left button.
Return                            ;End of action.


Whenever the right mouse button is released, the script checks whether the left button is being held down. If so, a message box pops up (to be replaced with whatever you need). In either case, the right-click is passed through to the OS (signified by the tilde). I tried it, and it doesn't interfere in any way with Strokes Plus or Windows. Those who really need this feature can use AHK in addition to S+.

Edited by - Cerberus on 01/31/2012 14:07:40
Go to Top of Page

Ampa

1 Posts

Posted - 02/02/2012 :  01:30:36  Show Profile
@Rob: Thanks for the detailed explanation. I was the original asker of the question (was having trouble getting on to the forum!).

@Cerberus: Just tried your AHK script but with no success. When I click the right mouse I simply get the right click menu of the app that is focused. :(
Go to Top of Page

Hax

128 Posts

Posted - 02/02/2012 :  02:49:27  Show Profile
~Lbutton Up::
If GetKeyState("Rbutton", "P")
Send {Volume_Mute}
Return


In this case, when I'm holding right mouse button down, I'm able to mute all sounds by pressing left mouse button.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/02/2012 :  03:26:48  Show Profile  Visit Rob's Homepage
What stroke button do you use, Hax? I'm curious because if you use the right button as your stroke button, you could accomplish the same thing in S+ =)

RE: AHK script not working for you Ampa - I'm not familiar with AHK at all, don't even have it installed, but is it supposed to consume the mouse press (directed at Cerberus)? Meaning, if you have a script that catches the mouse button like right-click, will it still pop up the context menu? The reason I ask is because what Ampa could be experiencing is a chain issue. Both S+ and AHK are installing mouse and keyboard hooks and if S+ was started first, followed by AHK, S+ would always be first in the hook chain, meaning S+ would handle the right-click and AHK wouldn't receive the right-click event. Whereas if AHK was started first, then S+, AHK would only consume the mouse events for which there's an AHK script associated, otherwise pass it on to the next hook in the chain, being S+.

This may not be the issue at all, but wanted to post this here for what it's worth from a technical perspective.
Go to Top of Page

Hax

128 Posts

Posted - 02/02/2012 :  05:03:08  Show Profile
Rob, I use the X2 button as my S+ stroke button. The right button is reserved for StrokeIt and surprisingly there is no conflict between SI and that AHK rocker gesture.

BTW, is it possible to use two stroke buttons simultaneously in S+?
Go to Top of Page

Cerberus

Netherlands
86 Posts

Posted - 02/02/2012 :  05:07:54  Show Profile  Visit Cerberus's Homepage
@Ampa: Strange! It works on my XP computer. Perhaps you could try running the script with Admin rights. It's very hard to troubleshoot this from a distance.

@Hax: Very nice!

@Rob: I don't know, but it works perfectly with S+ on my computer. AHK passes through the mouse click because of the tilde, so S+ won't notice a thing. And S+ passes through non-moving right-clicks, which indeed activate the AHK script for me (if I right-click while holding down the left button). What I see is the context menu popping up for a few milliseconds, then the AHK messagebox pops up to push away the context menu.
Go to Top of Page

Cerberus

Netherlands
86 Posts

Posted - 02/02/2012 :  05:09:19  Show Profile  Visit Cerberus's Homepage
quote:
Originally posted by Cerberus

@Ampa: Strange! It works on my XP computer. Perhaps you could try running the script with Admin rights. It's very hard to troubleshoot this from a distance.

@Hax: Very nice!

@Rob: I don't know, but it works perfectly with S+ on my computer. AHK passes through the mouse click because of the tilde, so S+ won't notice a thing, the rght-click is not consumed. All my gestures work. And S+ passes through non-moving right-clicks, which indeed activate the AHK script for me (if I right-click while holding down the left button). What I see is the context menu popping up for a few milliseconds, then the AHK messagebox pops up to push away the context menu.

Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/02/2012 :  05:13:13  Show Profile  Visit Rob's Homepage
quote:
Originally posted by Hax

Rob, I use the X2 button as my S+ stroke button. The right button is reserved for StrokeIt and surprisingly there is no conflict between SI and that AHK rocker gesture.

BTW, is it possible to use two stroke buttons simultaneously in S+?



No two draw buttons at the same time..well, it's difficult to explain.

Ok, so you have X2 set as stroke button. You could define an action which has left click as a modifier and leave the gesture drop down empty. Then, if you press X2 then left and let go of both, that action would fire.
Go to Top of Page

Hax

128 Posts

Posted - 02/02/2012 :  05:35:38  Show Profile
Rob, I'm aware of that, thanks. I will stay with that AHK gesture, because I use AHK anyway. There is a "script" for AHK called Radial menu and it's so powerful piece of the code. Everyone should check it out.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/02/2012 :  06:43:55  Show Profile  Visit Rob's Homepage
So what you're saying is I need to add a radial menu type of functionality to S+?

=)

Go to Top of Page

Hax

128 Posts

Posted - 02/02/2012 :  07:25:33  Show Profile
Hell, why not?
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/06/2012 :  08:22:33  Show Profile  Visit Rob's Homepage
So I've actually come up with an out-of-the-box way to have a left-to-right button rocker gesture; it's definitely not perfect, but I'm posting it here for what it's worth.

Make a copy of the S+ folder, to run as another instance of S+ which is set to Left as Stroke button (can't use the same StrokesPlus.xml config file, of course). You could delete the StrokesPlus.xml file in this new folder, to have that instance create a blank settings file, rather than delete all of the actions/app you won't use for the left button instance.

Open the second instance and create an action with only the Right button as a modifier, enter your Lua, and there you go!

However, there are caveats:

- Neither the right nor left button can be assigned as a modifier in either instance to an action which requires a drawn gesture. One of the instances is going to consume the other's opposing mouse event, or you'll be drawing lines in both instances at the same time, with neither aware that the other instance is capturing the opposing Stroke button's mouse action, thus not recognizing the modifier was ever pressed.

- Having the Left button as a Stroke button can be annoying when dragging (like scrolling, highlighting text), while you'd think you could reduce the Cancel Delay to 0, that gives you literally no time to complete a gesture, even if it's only modifier keys. S+ won't allow less than 50ms for this reason anyway. But, even 50ms isn't really enough time to click Left, click and release Right, then release Left. In this multiple-instance scenario, the Right button must be released while the Left button is still down or the Right button instance will fire the Right click at the mouse location, thinking you didn't make a gesture of any kind and you meant to just right-click. I was able to fairly consistently achieve this rocker-type functionality with a 250ms Cancel Delay, which isn't too bad of a timeout for Left drag activities.

Like I said, it's kind of hokey, but it technically works..though not how you really would like it to. Again, the fact that S+ is primarily designed for drawn gestures is why this doesn't really fit into the program logic.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/07/2012 :  11:08:37  Show Profile  Visit Rob's Homepage
Marking this as closed. The multiple instance option is as close as this is going to get for the foreseeable future.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/27/2012 :  02:09:04  Show Profile  Visit Rob's Homepage
Added rocker support in 2.0.13.
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