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
 New Features
 [ADDED] Have gestures timeout at cancel delay
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rob

USA
2615 Posts

Posted - 02/22/2012 :  23:17:32  Show Profile  Visit Rob's Homepage
Added in 1.7.0

Added an option in Preferences which you can uncheck to force gesture timeout to occur at the cancel delay regardless of mouse movement or modifier events.

elerouxx

Brazil
40 Posts

Posted - 06/29/2012 :  19:17:29  Show Profile  Visit elerouxx's Homepage
Hi Rob! This is my first post so first of all I wanted to say you are doing an amazing job! I have used every gesture application available, and S+ promises to be really powerful one because of the scripting and other reasons. all others have limitations here and there.

I use it with a graphic pen and a tablet PC so I will give you some feedback on that later. But I wanted to comment right away about this specific feature.

Having the timeout cancelled by movement is a must, so thanks for this, but I think it needs some threshold so S+ can tell when the user is really drawing a gesture or when he intended to stay still. Because the slightest, even invisible movement, cancels the timeout.

Currently, either: 1) you have this box checked and the timeout is (almost?) always cancelled, so the gesture never times out (and the timeout is useless) or 2) you have this box unchecked, in which case the timeout value is your time limit to finish drawing. If you have a 500ms timeout, that means you have half a second to finish your drawing, otherwise the time goes out and S+ will read the unfinished gesture as it is.

So maybe you could set a threshold limit of some pixels, like a 5 to 10 pixel area (customizable or not). If the mouse/pen stays in that area, that wouldn't be read as gesture movement, the gesture would be cancelled and you could use the mouse normally, which is specially useful when using the left mouse button for gestures. But if you start drawing right away, then the timeout is cancelled until you finish drawing the gesture.

In the case of a graphic pen, the tip of the pen is the same of the left button, so this would work like a charm.

Thanks for your attention!

Emilio



Edited by - elerouxx on 06/29/2012 19:18:25
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/30/2012 :  00:04:44  Show Profile  Visit Rob's Homepage
Hi Emilio!

I'm glad you're liking S+ so far (sans the issue you're experiencing). Try the update below and let me know if that's what you're looking for. The only item it doesn't address is "then the timeout is cancelled until you finish drawing the gesture". Instead, the cancel timer works as normal, but still requires you to move the cursor at least the minimum segment length again before resetting the timer; so it won't be indefinite as your request suggests. Though I suspect that isn't really your concern.

64-bit (just the EXE and DLL):
http://www.strokesplus.com/files/StrokesPlus_2.1.1_ThresholdTest_x64_chg.zip

32-bit (just the EXE and DLL):
http://www.strokesplus.com/files/StrokesPlus_2.1.1_ThresholdTest_x86_chg.zip

Here's my pending change log notes for what they're worth..or for anyone else reading that wants to test:

2.1.1
- Moved reset cancel delay check to inside the minimum segment length block. Basically, this means that the cancel delay will only be reset if the mouse has been moved more than the pixels defined for the minimum segment length (or if any modifer has been pressed, those always reset the cancel timer, if you have the option checked), instead of even a single pixel movement resetting the cancel timer. I can't think of a reason why this would be an issue, in fact it seems to make sense given the minimum segment length setting exists. Specifically, this addresses the issue of using a pen on a tablet where keeping the pen absolutely still is virtually impossible, leading to having no viable method to use S+ without significant compromise of general Windows usability while also being able to use S+. Unless you're specifically resetting the cancel timer by moving the mouse only a few pixels, this shouldn't affect anyone, or even be noticed (unless you defined a very large minimum segment length value, which doesn't seem practical). If this causes any issues, I'll break this functionality out into a new preference, but since this logic is in the mouse hook, I'd prefer to keep the checks to an absolute minimum for performance reasons; another preference means another CPU cycle for each mouse move. In fact, this change improves performance as the timer isn't killed and restarted every single mouse move, only when the mouse has been moved the minimum segment length. As I said, I believe this will be a completely transparent change, but make S+ far more usable for pen/tablet users.

Rob
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/30/2012 :  13:34:02  Show Profile  Visit Rob's Homepage
By the way, I've released 2.1.1 which includes the change mentioned here, so give it a spin and let me know.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/01/2012 :  17:27:28  Show Profile  Visit elerouxx's Homepage
Thank you very much! I tried it right away and it worked fine!

I didn't reply before because I was sorting out other kind of problems. It happens that the main application I use is Notion3, a music notation application (www.notionmusic.com).

In this application, as in many others, you have a default cursor to select notes, but you have a number of tools that allow you to put notes or other symbols.

I don't know why, but in this app, the gestures can only be drawn when the cursor is in 'default' mode, or selection mode. When I select any tool, par example 'add quarter notes', the cursor changes to the shape of a note, and I could add it by clicking. In this mode, I cannot draw any gesture. It could think that Notion3 is capturing the clicks in some way that they are not detectable by SP+, no matter the activation button I use.

Until now I have been using JustGestures, which doesn't have this issue. But it's less powerful and VERY CPU hungry. I was very excited when I tried SP+ but for some reason it doesnt work well with Notion. I'll install the new version and give you more feedback.

Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/01/2012 :  19:25:34  Show Profile  Visit Rob's Homepage
When I started working on S+, I noticed that Input Director (a program I use) hides the cursor when the mouse is controlling the other computer. In this state, S+ shouldn't be capturing the mouse. So I added a check in the mouse hook to skip the mouse hook if the cursor is hidden, which is probably why you're experiencing the issue you are. Although, I also have a check to see if the cursor is off-screen, which may be also keeping the Input Director issue at bay as I just tried with the new preference unchecked while the mouse was on the other computer and S+ wasn't capturing the mouse. The mouse hook was almost the first bit of code I started with, so it's possible the cursor check wasn't really needed, but no harm in leaving it as an option.

Try the update below, under Preferences there's an option named Check Cursor Flags*, uncheck that and see if it's working as you'd expect.

32-bit:
http://www.strokesplus.com/files/StrokesPlus_2.1.5_x86_chg.zip

64-bit:
http://www.strokesplus.com/files/StrokesPlus_2.1.5_x64_chg.zip
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/01/2012 :  20:53:48  Show Profile  Visit elerouxx's Homepage
wow, you are really fast!! Are you sure you're taking a break?

Yes, that really fixed this problem! Now I can go on configuring my gestures. I'll keep you posted and thank you very much!


Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/01/2012 :  20:58:41  Show Profile  Visit Rob's Homepage
Heh, yes I am...but I can't ignore something at the core which keeps S+ from functioning as it should.

New features, requests, or dumb ass questions will wait, though :-)
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/01/2012 :  21:21:04  Show Profile  Visit elerouxx's Homepage
This works very well. Now I have covered all I could do with JustGestures for much less cpu and battery price (Just Gestures turns my notebook into a hair drier).

But S+ is so much more powerful, I'm going beyond - I am building some kind of gesture interface that is virtually like writing music. Soon I'll post a video of this.

For instance, by drawing a quarter note at a certain spot, I can have S+ selecting the quarter note and click on the spot.

Sometimes the clicks don't work properly, so I'm trying to add different delays. But I'll post about this on the proper thread. Ty again!

Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/01/2012 :  22:15:12  Show Profile  Visit Rob's Homepage
I look forward to seeing what you're coming up with. Feel free to post questions about building actions...I can do those in my sleep and don't mind. You're clearly an articulate and intelligent person who wouldn't ask a question unless you've exhausted all available resources then hand deliver it with the precise point of failure. Those are my favorite :-)

That's why you get immediate fixes, you've done all the work for me!
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/02/2012 :  00:20:58  Show Profile  Visit elerouxx's Homepage
oh thanks!

I have a suggestion about this feature. I think that the gesture should be read only if the user releases the triggering button/key, meaning the user really completes the gesture on his own. If the user doesn't release the button but stops enough for the timeout, the gesture should be cancelled. It seems to me that, when the time is out in any context (with or without the timeout reset checkbox), the gesture is read when the time gets out even when the mouse button/pen is still down.

So where should I start a thread about what i'm doing? I don't want to mess your forums up.

I'll try to explain a little. Since I use a tablet, and I like to use it as a slate (so trying to avoid using the keyboard) I was using gestures to select different tools, so I can draw a gesture that remembers a symbol (say, a musical note, a clef) and then start putting that around the document.

Now, using gsx and gsy and the mouse action functions, I'm able to directly write the symbols on place using the gesture! for instance, I just draw a G-clef shaped gesture somewhere and S+ sends the appropriate shortcuts for activating the G-clef symbol AND THEN clicks on the place I drew the gesture! works like magic.

so far I'm able to put notes and other symbols in place, but I noticed that sometimes the clicks don't work as expected. Specially with scripts that involve more than two clicks or click-drag (using a sequence of mouse funcions).

I'm trying to balance sort things out with some acDelay functions, and also since I'm using left mouse button (pen tip) to activate gestures, i'm using the acDisableNext function, so the script clicking and dragging don't generate another gesture.

It seems to me that sometimes the actual click issued in the functions doesn't fall where the gesture actually started or ended. Is there a way the realtime mouse movement will affect where the scripted clicks end up going?


Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/02/2012 :  09:36:13  Show Profile  Visit Rob's Homepage
You're welcome to start a thread under General Action Scripts as that seems relevant.

Yes, physical mouse movements will interfere with synthesized ones. I'll give some thought to if there's a way around that, but the only one I can come up with off the top of my head is to add a new action which toggles a flag to consume all mouse events, though I'd have to see if they're synthesized or not, etc. so it could get ugly..but will think about it.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/02/2012 :  10:38:54  Show Profile  Visit Rob's Homepage
Try the build below for preventing physical input from interfering with actions (it includes the code changes in 2.1.51 as well, from the Requests thread).
Added acConsumePhysicalInput(bool) action. acConsumePhysicalInput(1) tells S+ to consume ALL physical input (mouse and keyboard). 
This may be useful if you're about to call a mouse or keyboard action where you don't want any physical input to interfere with the action. 
But make sure you call again, passing 0 [acConsumePhysicalInput(0)], to enable input or your computer may become unusable!

Here's some example code:
acConsumePhysicalInput(1) --consume all physical input
acMouseMove(100, 100) --move the mouse to coordinates 100,100
acDelay(5000) --pause, just to demonstrate you can't do anything with the mouse/keyboard during the delay
acConsumePhysicalInput(0) --stop consuming all input

32-bit:
http://www.strokesplus.com/files/StrokesPlus_2.1.52_x86_chg.zip

64-bit:
http://www.strokesplus.com/files/StrokesPlus_2.1.52_x64_chg.zip

Note that this means you don't need to call acDisableNext.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/02/2012 :  11:07:28  Show Profile  Visit elerouxx's Homepage
right away!
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/02/2012 :  16:50:49  Show Profile  Visit elerouxx's Homepage
Seems to work very nice! I get things right most of the time.
You have no idea what you are accomplishing here with your program. It's just wonderful. I'll soon post a video about this, but I am really writing music directly on the screen.

I am not sure, It might seem that a few of the times, when I ask a script to click at gsx, gsy, S+ clicks near the end of the gesture instead of the start. I don't know how this is possible.

I thought the gesture was not being recognized and, instead, the other application was reading a simple click at the cursor at the end of the timeout. But I confirmed that this happens running the script because I added a BEEP among the script commands.


By the way, I was wrong when I thought that S+ reads the gesture even if you don't release the mouse. The gesture was cancelled correctly, not being read, but the application was simply reacting to a single mouse click (after the gesture is cancelled, the initial click is passed to the application, right?). So it works fine.

Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/02/2012 :  17:05:40  Show Profile  Visit Rob's Homepage
Yes, S+ replays the mouse events that would've happened if it hadn't consumed them. If you've started drawing a gesture that you want to cancel, you can always just draw a garbage gesture that isn't recognized to prevent the cancel replay from happening.

It works this way because if you, for example, wanted to right-click drag files in Explorer to copy/move them, when you bring the cursor to where you wanted to drop them and wait for the gesture to timeout, S+ will replay the right-click down event back where you started, then move the mouse back to where you had it...so when you let go of the right button, the expected Copy/Move/etc. context menu would appear.

Post the script that's exhibiting the odd clicking coordinate behavior and I'll see if I can reproduce. Also let me know if you have defined any sp_before_action or sp_after_action functions.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/02/2012 :  23:46:38  Show Profile  Visit elerouxx's Homepage
My scripts are very simple. For instance this one:

acSendKeys("=q")
acDisableNext()
acDelay(100)
acMouseClick(gbl, gbb, 2, 1,1)

This is called by a gesture that resembles an inverted L: a short trace left-right and then a beam upwards, similar to quick writing a quarter note on a music staff. I used to use gsx and gsy coordinates but in this gesture, these are more accurate. In either case, about 10% of the time, the click is done at a wrong place.


Another example is the one to select objects in an area by drawing a rectangle. It works most part of the time, but sometimes it does the clicks on wrong places too.

--acDelay(100)
--acConsumePhysicalInput(1) --(doesnt work with pen)
acSendKeys("{ESC}")
acDelay(50)
acDisableNext()
acMouseClick(gbl, gbt,2, 1, 0)
acDelay(50)
acMouseMove(gbr, gbb)
acDelay(50)
acMouseClick(gbr, gbb, 2, 0, 1)


But I also have some new information. The acConsumePhysicalInput(1) function works with a normal mouse but not with a pen. I just installed S+ in my desktop PC in which I have a mouse and a wacom graphic pen so I can keep testing both. The mouse 'freezes' for whatever delay I put after the command, but the pen can move freely after drawing the gesture. The same happens on the tabletPC.

Edit: just tried the above script with the mouse, and adding acConsumePhysicalInput(1) at the start and (0) at the end of the script. Since the physical input is disabled, the script doesn't work. And when using the pen, the consume-command doesn't work and the pen can move normally so the script works.


Edited by - elerouxx on 07/02/2012 23:55:12
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/02/2012 :  23:51:24  Show Profile  Visit Rob's Homepage
Try the version I posted in the other thread, I think I fixed the acConsumePhysicalInput issue:

http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=425
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/02/2012 :  23:53:48  Show Profile  Visit Rob's Homepage
Although, it may very well be that the pen has its own software that injects mouse activities..so it may not work at all =(

Now, I'm curious if those gestures click in the wrong spot if you use a mouse instead of the pen (just for the purpose of testing).
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/03/2012 :  00:00:34  Show Profile  Visit elerouxx's Homepage
sorry, I edited the last post while you were replying.

Well, here in my desktop all works better with the mouse. No fails on the clicks so far.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:02:49  Show Profile  Visit Rob's Homepage
You're right, it's not...I'd only tested the mouse move after consuming and it did move so I didn't check further.

I see what you're saying about that and will look into it. Although, I'm afraid the Wacom pen may prove to be something which is going to cause a conflict. Maybe I'll have to see if I can find one used or something to test with =)

Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:06:55  Show Profile  Visit Rob's Homepage
No, I see what's happening..the mouse hook is accepting synthesized input as normal, so if you're left click dragging, it's trying to draw a gesture (if I understand the pen and your setup correctly)
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:09:35  Show Profile  Visit Rob's Homepage
Ok, so without complicating S+..if there's even a way to cleanly do it anyway, the calls to acDisableNext() will still have to remain before any acMouseClick which presses the stroke button down.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:13:07  Show Profile  Visit Rob's Homepage
I think the Wacom pen's software is messing things up as it's sending synthesized mouse events while S+ is running scripts..creating a conflict and unpredictable results.

And since it's sending synthesized mouse events, there's no way for S+ to distinguish its own synthesized mouse events from Wacom's (the Windows mouse hook message doesn't contain that data)..I can only differentiate between physical ones and synthesized...
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:19:19  Show Profile  Visit Rob's Homepage
Yea, doing some random Google searches relating to Wacom and mouse events suggests their software injects the mouse events (which makes perfect sense for their hardware); however, that will cause positioning problems unless they support some kind of API call to temporarily suspend the pen software activity; but I can't think of a good reason why they would've ever thought to have that functionality...since this is probably about the only use case for it!
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:20:44  Show Profile  Visit Rob's Homepage
The only other thing I can think of is a delay at the beginning of the script, which gives you time to move the pen away...but that's pretty unproductive..
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/03/2012 :  00:27:57  Show Profile  Visit elerouxx's Homepage
Yeah, so it seems after some tests.
I am new to Lua, and it has been years since I coded something. so I don't know the internals. I thought that 'acMouseClick(x,y,2,1,1)' would send a click at x,y independent of the data received from any pointing device.

Anyway, you have already solved most of the issues. These moments in which the clicks go wrong aren't enough to be a problem. If you eventually improve this, I'll help as much as I can.

I plan to shot a short video of these scripts in action tomorrow.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:47:24  Show Profile  Visit Rob's Homepage
Wait, don't go away yet!

Try this:

32-bit:
http://www.strokesplus.com/files/StrokesPlus_2.1.54_x86_chg.zip

64-bit:
http://www.strokesplus.com/files/StrokesPlus_2.1.54_x64_chg.zip

While I can't tell if Wacom is injecting the message, I CAN pass extra info along with S+ acMouseMove and acMouseClick and check for those. I'm hoping this actually works as I intended.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:51:32  Show Profile  Visit Rob's Homepage
If that works right, the pen input should also be consumed..hopefully keeping the script coordinates all correct.

acMouseClick translates to the mouse_event function in Windows (acWhatever calls are not part of Lua, those are S+ functions that are exposed to Lua)

Back to your confusion, if S+ sends a mouse_event to 100,100 and click, Wacom can also send its own mouse_event calls at literally the same time, causing a race condition where no one knows who the winner is, or whether the click happens before the other one is sending a mouse move.

Both S+ and Wacom are calling the exact same Windows function (or maybe SendInput..same effect though): http://msdn.microsoft.com/en-us/library/windows/desktop/ms646260.aspx

So they both have the right to be the winner..all a matter of luck and timing.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  00:56:15  Show Profile  Visit Rob's Homepage
Oh, and you shouldn't need the acDisableNext call now since I'm checking for the extra info passed along with acMouseMove and acMouseClick..if that extra info is there, I'm skipping the mouse hook entirely, if it's not (and acConsumePhysicalInput was called), I'm consuming everything..which SHOULD include Wacom's mouse events.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/03/2012 :  01:46:42  Show Profile  Visit elerouxx's Homepage
Yeah, acConsume.. works now with the pen also!
I can't tell you much yet about how it's working. I think the acMouseMove function doesn't work while Consume is active, is that possible? so, in this box selection script that clicks and drags, I have to activate acConsume before the clicks (mouse down, and mouse up at the end), but I have to deactivate acConsume(0) before the acMouseMove in the middle.

More on that tomorrow... thank you again for your awesome work and good nite.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  01:55:43  Show Profile  Visit Rob's Homepage
Yes!

Well, acMouseMove works on my end during consume (just some random right-click drag I test in Explorer to see it's highlighting the selected area then right-clicking..long pauses intentional so I can see what's happening):
acConsumePhysicalInput(1)
acMouseMove(700, 700) 
acDelay(2000)
acMouseClick(700, 700,0, 1, 0)
acDelay(50)
acMouseMove(900, 300)
acDelay(500)
acMouseClick(1000, 300,0, 0, 1)
acDelay(50)
acConsumePhysicalInput(0)

Anyway, play around with it and see how it goes.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/03/2012 :  18:22:56  Show Profile  Visit elerouxx's Homepage
I tested this:

acConsumePhysicalInput(1)
acMouseMove(200, 200)
acDelay(500)
acMouseClick(200, 200,2, 1, 0)
acDelay(500)
acMouseMove(600, 200)
acDelay(500)
acMouseClick(600, 200,2, 0, 1)
acDelay(500)
acConsumePhysicalInput(0)

as a global action, and tried it with Windows' paint app, after selecting the pencil tool and a color.

If I do the gesture and then take the pen off the screen (during the first delay), the script draws a line from (200,200) to (600,200).
If I keep the pen over the screen, I can see still see the cursor go to the certain spots, but no clicks seem to be done anywhere. In either case the cursor stops responding to the pen during the script.

I have also tried taking the pen off the screen at different moments. I see that instead of the line, the cursor draws either the first dot or the last dot with the pencil tool.

Of some sort, having the pencil hovering the screen might be as a continuous 'mouse up', so maybe it's impossible for the action to 'click and hold' using acMouseClick (x,y,2,1,0).

Another detail to break your head: in windows paint, when I use the mouse (or the notebook trackpad) and I left-click and drag the gesture, I can see the blue line from Strokes+ and then the action is invoked. Nothing is painted by the mouse at the time I am drawing the gesture.

When I use the pen, however, I see the blue line from Strokes+ but also I can see the pencil line being drawing underneath. The gesture is invoked, but I also drew on the canvas at the same time.

Fortunately this doesn't happen in Notion.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  18:39:57  Show Profile  Visit Rob's Homepage
The thing about the Wacom software is that it's a driver and resides/executes on top of the kernel, but also sends synthesized mouse events (where a mouse driver sends the raw mouse input), while S+ runs at a much higher level as a hook. Thus, it's quite possible that some events are happening before S+ even gets the chance to intercept them.

However, without the software and hardware on my system, I can't determine what's going on. If you can get Spy++, you can watch the messages in realtime and see exactly what's happening and the sequence (I use Spy++ constantly while developing S+ and/or making action functions). It probably comes with the free version of Visual Studio Express...but I'm not certain.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/03/2012 :  18:57:25  Show Profile  Visit Rob's Homepage
Also, what version of Windows are you running?
And is it 32-bit or 64-bit?
(and, if you know, is the Wacom and Notion software 32 or 64-bit?)
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/03/2012 :  21:00:40  Show Profile  Visit elerouxx's Homepage
I am using windows 7-32-bit in the tabletPC, and win7-64 on this desktop computer. The tabletPC has a wacom pen for tabletPCs and the desktop has a regular ms mouse and a wacom graphire3 graphic tablet. Things act pretty much the same on both. The pen on the tablet and the graphire act the same, as do the mouse vs. the notebook's trackpad. I installed s+ 64-bit on the 64bit computer.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/03/2012 :  21:04:23  Show Profile  Visit elerouxx's Homepage
Ok, I'm starting to mess up things... so I am putting some notes together instead of sending separated bits.


In Notion, this script works wonderfully with the pen.


acSendKeys("{ESC}")
acDelay(50)
acDisableNext()
acMouseClick(gsx, gsy, 2, 1, 0)
acDelay(50)
--acMouseMove(gex, gey) --not needed
acMouseClick(gex, gey, 2, 0, 1)


It drag-selects things from gsx,gsy to gex,gey. I don't even need to

'acMouseMove': clicking down in gsx,gsy and up in gex,gey is enough for the app to understand the click-drag-release.

Even if I put big delays between the mouse commands, and I can see the selection box following the pen, the clicks are issued at the intended spots, except if I try hard enough to get it wrong. So it works fine and, in very rare ocasions, either or both of the clicks go to a wrong spot.

Now, with the MOUSE, the strangest thing. If I draw the gesture and then STAND STILL, I can see the cursor going to gsx,gsy and then clicking, but it seems it issues a DOWN AND UP click. Then I see the pointer go to gex,gey but no click, no selection box is drawn or follows the cursor.


However, if I draw the gesture with the mouse, and then keep the mouse
moving (without clicking anywhere of course) I can see the selection box being drawn, and follow my movement, and the second click is done on the right place finishing the selection correctly!

I haven't been able to get the selection wrong, unlike the pen, but it only works if I am always moving the mouse.

acMouseMove makes no difference in the script in this case.



This other script acts a little odd:

acSendKeys("{ESC}")
acDelay(500)
acConsumePhysicalInput(1)
acMouseClick(gsx, gsy, 2, 1, 0)
acDelay(500)
--acMouseMove(gex, gey)
acMouseClick(gex, gey, 2, 0, 1)
acConsumePhysicalInput(0)


It doesn't draw the selection box in any case (mouse or pen) but I can tell it's dragging the mouse. If I start the gesture on an element, it picks it and drags it. But if I start on an empty space, gsx,gsy is just clicked down then up, no selection box is dragged. Pen and mouse act the same.



IN WINDOWS:

I tried both scripts in windows explorer, in a folder full of files. It acts as this: if I draw the gesture ("L" for example) from an empty spot to anyplace, it draws a selection box and selects all files/folders in its way. But if I draw the gesture starting on a file and ending on a folder, One would expect the script to pick the file and put it into the folder. Instead, the FILE is highlighted/selected (like a mouseDown+up), and nothing else happens, even while you can see the cursor arrow hovering from the file to the folder at the end of the gesture.

Now, if I modify the second mouse click to acMouseClick(gex,gey,1,1), it works as expected in windows explorer with either mouse or pen! it either draws a selection box properly if you do the gesture from an empty spot, or if you do the gesture over a file and ending on a folder, it drags the file inside the folder.

And in Notion it creates a graphical bug in which the selection box is drawn barely near the desired coordinates and stays there as a glitch. but nothing is selected nor the app is affected in any way for this fake selection box. Not a surprise since we're sending... well, i don't know anymore what we're sending to the app, for the first click is (DOWN) and the second is (DOWN _ UP).

Of course some of these issues or glitches are not S+'s fault but Notion's, because of the nature of its coding and the way it uses graphics (I think it uses openGL). Still, it's weird how the scripts act in windows.

Sorry if this looks messy, I'm just gathering all the info I can.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/04/2012 :  02:02:05  Show Profile  Visit Rob's Homepage
...and this is the reason gesture programs are niche, because there are so many external (and often unknown) dependencies/variables.

Take your Explorer example, what's happening behind the scenes is when you click and drag, Explorer actually changes the capture to a different (invisible except when dragging) window. So if you've fired all of the events too fast or in a way that the target program isn't expecting, these types of oddities arise.

This script works every time for me (right-click drag, from gesture start to gesture end):
acConsumePhysicalInput(1)
acMouseClick(gsx,gsy,0, 1, 0)
acDelay(250) --Give the invisible drag window time to load and listen for mouse events
acMouseMove(gex-10, gey-10) --Move the mouse to somewhere other than the final destination
acDelay(25) --Let the drag window process this message (the mouse movement)
acMouseClick(gex, gey,0, 0, 1) --Let go of the right button at the final destination
acConsumePhysicalInput(0)

However, it took quite a bit of tweaking (and using Spy++) to get working properly. It's just like making an action to perform a Shift+Delete, you can't simply send acSendKeys("+{DELETE}"), you actually need a shift down, then delete followed by a delay (to let the delete confirmation load), then shift up..otherwise, the Windows Delete confirmation isn't yet loaded and doesn't see the Shift key is down, so it thinks you're only sending to the Recycle Bin.

In the above example, it seems that the hidden (drag) window wants to see some mouse movement (which is why I move to a different coordinate, then release at the desired one) to consider an action is actually happening..if it gets loaded and instantly receives the right mouse up, it doesn't think the mouse moved. So it really comes down to the program you're targeting and how it interprets (and expects) things to happen; which means trial and error often times!

I'm not sure what's going on in Notion specifically, but I would try things like I did in the above script. But think about what I've described and your own observations: The first script works fine only when it's receiving mouse movements (as you witnessed, the pen is almost always sending them, but the mouse is easy to stop). It could be that in their code, they receive the mouse down, then wait for the mouse movement messages (regardless of coordinates) to initiate a drag box, then respond to the mouse up..but without some mouse movements between, the code may think nothing really happened ..kind of like a threshold or something rather than constantly annoying the user with starting a drag when the mouse only moved 2px. Again, I don't know what their code is doing..logic would dictate the distance between start and stop should suffice, but their code may have a counter on mouse movements which controls whether it considers a drag action is happening.

That's about all I can tell you on this; it's a lot of trial and error unless you have access to the target program's source code. Try to stop and think about what's actually happening if you were to perform the action yourself, then build the script.

Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/04/2012 :  09:37:52  Show Profile  Visit elerouxx's Homepage

Ok, got it! Thank you very much for your clear reply, it will help me a lot.

As you saw in the video, things are working wonderfully. Since then, I have already refined some of the scripts. acConsumePhysicalInput works pretty fine for all tools that don't require dragging, and for the others I'll try to get them working by meditation... lol. I mean it. Now I see it's a matter of [smart] trial and error.

My tabletPC is old, but I have hope that I will be able to use this software combination on some device of the future, maybe a windows 8 tablet with a real cpu and a stylus, who knows.
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/04/2012 :  11:44:42  Show Profile  Visit elerouxx's Homepage
You were completely right. these two scripts work flawlessly both with mouse and pen. I prefer the second one, it feels and looks more solid (you don't see suspicious activity until the action is done).


acSendKeys("{ESC}")
acDisableNext()
acMouseClick(gsx, gsy, 2, 1, 0)
acMouseMove(gsx, gsy+6) -- to make sure app understands we're dragging
acDelay(50)
acMouseClick(gex, gey, 2, 0, 1) --no need to move, just upclick @gex,gey



acSendKeys("{ESC}")
acConsumePhysicalInput(1)
acMouseClick(gsx, gsy, 2, 1, 0)
acMouseMove(gsx, gsy+6) -- to make sure app understands we're dragging
acDelay(50)
acMouseClick(gex, gey, 2, 0, 1) --no need to move, just upclick @gex,gey
acConsumePhysicalInput(0)


I only kept the delay where it was necessary and reduced it to a minimum. This is working fine on my i5 desktop, 64bit - so I'll try on my slower notebook to see it needs more delay or something.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/04/2012 :  14:41:44  Show Profile  Visit Rob's Homepage
Glad to hear!
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/04/2012 :  15:58:43  Show Profile  Visit Rob's Homepage
When you have a little time, I think it would be fantastic if you made a short (30-60 seconds), nicely edited video that really captures S+ being used in Notion. Showing (focusing on) various gestures creating the music and with the closing scene playing the music it helped create. I'm imagining something that would involve many little clips grafted together leading the the music playing; 30 seconds is probably long enough to keep their attention and interest

I think I need to make an actual website to accompany the forum and feel a video like that right on the home page would really convey what can be done.

I'm simply terrible (inexperienced) with video editing or I would try to rework yours as all the elements are there, but you're a much more creative person than I am and believe it wouldn't take you too much effort...again, when you have some free time; I certainly don't have a website together yet, or even close!
Go to Top of Page

elerouxx

Brazil
40 Posts

Posted - 07/04/2012 :  16:10:43  Show Profile  Visit elerouxx's Homepage
Yeah, I'll edit a 30 second video! That one wasn't really good.

I actually work in video and animation, I am a director and editor. I should be ashame. But you know... "em casa de ferreiro, espeto de pau" (I think in english would be "The shoemaker's son always goes barefoot") I have to get some time so I produce a short video worth the quality of both Notion and S+.

Thanks for asking for the video, I need someone to ask me to do things otherwise I won't do them.

Emilio Le Roux
www.moscafilms.com.br
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