GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

Post your working scripts, libraries and tools for AHK v1.1 and older
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

Re: GGGlide - Mouse cursor momentum for touchpad (ergonomics & productivity enhancement)

06 Mar 2018, 02:51

IOrot said :
<<Changed the way the pointer slows down, let me know if it suits you any better.>>

Hello,

Sorry, it isn't really helpful because as I said I use both Touchpad *and* mouse, so the cursor touchpad behavior continues with the mouse and it is not so easy... Anyway thanks for the efforts :-)

Best Regards,
Guy
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse cursor momentum for touchpad (ergonomics & productivity enhancement)

06 Mar 2018, 11:04

evilC wrote:I previously mentioned how to get better timers, but I realised that I did not point out that as far as I can tell, part of your code is not doing what you think it is.
DllCall("Sleep", UInt, 2) will not sleep for 2ms surely, will it not sleep for the min system granularity? (Probably ~15ms)

Code: Select all

start := A_TickCount
Loop 100 {
    DllCall("Sleep", UInt, 2)
}
MsgBox % (A_TickCount - start) / 100
On my work system , I get ~7, not 2
If you want to get a "smooth" glide, you probably do not want sleep (Use QPX or MicroTimer instead)

To address your previous comments (Better late than never!), my general point was that your current code is based on cursor position, which suffers from a number of drawbacks:
1) You have to do calculations to find the delta change. If the cursor hits the edge of the screen, you get none.
2) Detecting that the user moved the mouse (stop glide) requires further calculations (It looks like you are saying "Well the glide alone would have put the cursor here, so if it is somewhere else, the user moved the mouse")
If you used RawInput to detect input, and a mouse_event dllcall to do the glide, then you could just check each RawInput packet for the LLMHF_INJECTED flag - if it is set, then the movement was caused your dllcall, if it is not set, the movement came from the real mouse, and so stop the glide.
Hi C !
Glad you are back! :D Thanks for taking the time to go through my script. You are the only one that can help me with this madness! :? Same results happen on my machine too with your code but this is not representative of how my script works. Turning Critical On makes a huge difference but try out the snippet below for a 1 ms sleep:

Code: Select all

Critical	On
TimePeriod:=1
DllCall("Winmm\timeBeginPeriod", UInt, TimePeriod)
DllCall("QueryPerformanceFrequency", "Int64*", cFr)
DllCall("QueryPerformanceCounter", "Int64*", cT0)
Loop 100 {
    DllCall("Sleep", UInt, 1)
}
DllCall("QueryPerformanceCounter", "Int64*", cT1)
MsgBox % 1000*(cT1-cT0)/(100*cFr)
DllCall("Winmm\timeEndPeriod", UInt, TimePeriod) 

1)
It is given that your RawInput approach has different usecases (e.g mouse + FPS games where the pointer might be locked in the center of the screen). You are right that my coordinate calculation approach might/should fail at these cases (FPS are untested, point&click strategy games work ok).
On the other hand, the extent of such instances is very limited and the practicality of playing Counterstrike on a touchpad is arguable. There is no "desktop use" scenario in which you would desire your cursor to continue gliding past the edge of the available screen. I do not want to sound dogmatic but none come to mind (it has been tested with multiple monitor setups and it works fine).
Stopping the pointers' gliding movement when hitting the edge of the screen is a constraint you always will have to enforce and a very good one to have (reduces CPU load, you can use frictionless gliding, etc).

2)
Exactly, that is how it works. The glide moves pointer at position A, sleep, get current position B, compare two coordinates, if not position A=B, user moved pointer. A detail worth pointing out here is that if the user has moved the pointer, I need to know position B (+tickcount) anyway since it is the first data point of the monitoring data for a possible new glide. Also, the time it takes for these actions is consistent making the gliding smooth-looking.
I agree that in the Gliding Loop I need to:
get tickcount, get cursor position and compare two integers which in the case of the user not moving the pointer are useless data. I like a lot the idea of improving this and would like to improve it. If RawInput works better for this I would like to try it.

Please correct my misunderstanding, when you spot any, but my worries about RawInput are the following:
a) Will it be faster? How many RawInput packets will I have to get and check for the injected flag? If I perform a buffered read I assume it will be minimum one packet, since you read your own movement. Will it be more than two or two if the user moves? Will it include other unrelated packets I must filter? [As I have noticed even simple things as calling functions are slowing my script down, I am afraid this overhead might make it slower or it might run on irregular timings (depending on number of packets in buffer etc.) making the gliding irregular].
b) In the case of unbuffered read do I risk missing the non-injected packet?
c) More importantly, I see very odd situations in regards with touchpad devices and their drivers. There are undetectable right clicks, non-standard behaviour for gestures, pre-processing of touch data etc. Reading on-screen position may not be the best but it is universal. The "traditional mouse" workings may work similarly or predictably in most cases but each touchpad I have encountered seems “custom” in the way things are implemented and I am concerned that would make RawInput hard to use.
d) I have no idea how RawInput works as far as the time/tickcount that each input happened.

Actually, if you still think that it would be OK and you have a snippet I could start with I can try it out and see how things work. :D
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: GGGlide - Mouse cursor momentum for touchpad (ergonomics & productivity enhancement)

06 Mar 2018, 12:28

How many RawInput packets will I have to get and check for the injected flag
Lots. In the order of hundreds to thousands a second.
So I suppose that is a disadvantage.
I have seen no issues wrt RawInput and touchpad signals - I could see an issue with "absolute" devices (ie touch-screen type), but this technique is fundamentally inapplicable in that scenario anyway.
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse cursor momentum for touchpad (ergonomics & productivity enhancement)

12 Mar 2018, 07:44

evilC wrote:
How many RawInput packets will I have to get and check for the injected flag
Lots. In the order of hundreds to thousands a second.
So I suppose that is a disadvantage.
I have seen no issues wrt RawInput and touchpad signals - I could see an issue with "absolute" devices (ie touch-screen type), but this technique is fundamentally inapplicable in that scenario anyway.
Well if it is in the low hundreds per second that could be ok. Thanks for helping me out ! :D You are right though, I should investigate deeper the RawInput route eventually. :think:
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse cursor momentum for touchpad (ergonomics & productivity enhancement)

27 Mar 2018, 15:53

evilC wrote:
How many RawInput packets will I have to get and check for the injected flag
Lots. In the order of hundreds to thousands a second.
So I suppose that is a disadvantage.
I have seen no issues wrt RawInput and touchpad signals - I could see an issue with "absolute" devices (ie touch-screen type), but this technique is fundamentally inapplicable in that scenario anyway.
I noticed that SetCursorPos does not generate RawInput packets, maybe that would work easier than filtering out the injected packets? Unsure if SetCursorPos would work in FPS games though. I settled with using the GetQueueStatus to check QS_RAWINPUT for raw input messages but without actually reading any.
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum (ergonomic/productivity enhancement)

11 May 2018, 07:05

GUI for changing speed threshold added.
benderguy

Re: GGGlide - Mouse Pointer Momentum [v1.96](ergonomic/productivity enhancement)

18 Jun 2018, 09:22

I really miss my old Thinkpad laptop's synaptics momentum features, so am trying this on my new Dell XPS. Thank you so much for your time on this! A few questions:
1) While I'm playing with the threshold speed, and think I can get it right, the glide speed after activation is too fast. What settings could I tweak to make the glide slow down faster while not affecting the finger-on trackpad speed?
2) I use both a mouse and trackpad. This feature affects the mouse and make is tougher to use. Is there a way to make it only apply the trackpad?
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

Re: GGGlide - Mouse Pointer Momentum [v1.96](ergonomic/productivity enhancement)

18 Jun 2018, 10:11

Hello all,

I strongly agree with BenderGuy and his second point : without any solution to only apply GGGlide to trackpad (allowing us using both Trackpad and mouse), it is alas often unusable. It is very a pity because this piece of software could be very useful ! :-/

Thanks again for your attention and your time,
Guy
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.96](ergonomic/productivity enhancement)

19 Jun 2018, 11:35

benderguy wrote:I really miss my old Thinkpad laptop's synaptics momentum features, so am trying this on my new Dell XPS. Thank you so much for your time on this! A few questions:
1) While I'm playing with the threshold speed, and think I can get it right, the glide speed after activation is too fast. What settings could I tweak to make the glide slow down faster while not affecting the finger-on trackpad speed?
2) I use both a mouse and trackpad. This feature affects the mouse and make is tougher to use. Is there a way to make it only apply the trackpad?

Great to hear you like GGGlide! I made several changes which should help with point 1, this was surely an issue with the previous version. Let me know if it is any better now.
2) I introduced a sort-of deadzone feature which should make mouse use better (maybe?). It should filter small displacements from short abrupt pointer mouse movements.

There is an updated GUI where you can modify more parameters but you may find your previous settings are not very relevant given the updated code. Run in a separate folder and test first. When you settle on some nice settings please post them here with some feedback. :D
There is an advanced parameters mode :crazy: but I do not recommend it as starting point.
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.96](ergonomic/productivity enhancement)

19 Jun 2018, 12:36

CapGuy wrote:Hello all,

I strongly agree with BenderGuy and his second point : without any solution to only apply GGGlide to trackpad (allowing us using both Trackpad and mouse), it is alas often unusable. It is very a pity because this piece of software could be very useful ! :-/

Thanks again for your attention and your time,
Guy
There are some possible workarounds but nothing simple that comes to mind atm. I will figure it out eventually. Try the new version and let me know if maybe reducing the time limit helps out.
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

Re: GGGlide - Mouse Pointer Momentum [v1.96](ergonomic/productivity enhancement)

19 Jun 2018, 12:41

IOrot wrote: There are some possible workarounds but nothing simple that comes to mind atm. I will figure it out eventually. Try the new version and let me know if maybe reducing the time limit helps out.
Thanks a lot for your attention and all your amazing work !
Well I'll try it ASAP, in the mean time I hope some will do, too...

Best Regards,
Guy
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

21 Jun 2018, 12:18

Implemented a solution! :D Download the new GGGlide & SSStumble ! You can now selectively disable your mice.
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

21 Jun 2018, 13:12

Hello IOrot,
thanks again a lot, but alas it seems to not work on my side (mouse is well recognized, but if I move the mouse too quick, the mouse cursor continues to glide...)
Hoping this will help,
Guy
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

22 Jun 2018, 03:47

CapGuy wrote:Hello IOrot,
thanks again a lot, but alas it seems to not work on my side (mouse is well recognized, but if I move the mouse too quick, the mouse cursor continues to glide...)
Hoping this will help,
Guy
Thanks for trying it out! :D
Could you give more details as to what happens? (Btw, how do you like the new GGGsetup?)

1. You launch SSStumble, your mouse is recognised and added to the disabled devices list.

2. You launch SSStumble again, wait for the message box timeout, GGGlide is launched automatically and when you move the mouse you just added GGGlide does not pause. Correct? (When paused GGGlide changes tray icon).

Tell me more about the issue to fix it (including OS).

Some SSStumble Notes:
- SSStumble disables GGGlide only once the current glide has been completed/interrupted (assuming the pointer is currently gliding when switching to the disabled mouse/device). Only evident if pausing using a hotkey.
- SSStumble only works with the new version of GGGlide v1.97.1 which came out yesterday. Any older version will not work.
- SSStumble must be running in the background in order to monitor the device which you are using.
- Saved devices need to be added again if they are plugged in a different USB port.

Can you see the GGGlide icon changing from "enabled" to "disabled" ?
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

22 Jun 2018, 10:06

Hello,
You're welcome !
From my side I apologize because I have no time left enough to help you very much...

Anyway, I have downloaded the last ones (both GGGsetup.ahk and SSStumble.ahk),
put them in an "20180622" folder under my "C:\Program Files\AutoHotkey\" then tried to run the first GGGsetup.ahk,
but I have already an error as the attachment shows :
2018-06-22 (2).png
2018-06-22 (2).png (52.69 KiB) Viewed 3678 times
Hoping this will help,
Guy
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

22 Jun 2018, 10:56

CapGuy wrote:Hello,
You're welcome !
From my side I apologize because I have no time left enough to help you very much...

Anyway, I have downloaded the last ones (both GGGsetup.ahk and SSStumble.ahk),
put them in an "20180622" folder under my "C:\Program Files\AutoHotkey\" then tried to run the first GGGsetup.ahk,
but I have already an error as the attachment shows :
2018-06-22 (2).png

Hoping this will help,
Guy
No worries the screenshot was very helpful. It is an easy fix! You have to run the GGGsetup first to create the GGGlide script. When you are finished with the setup then run SSStumble.
Good you pointed that out. I will add a check for GGGlide with an informative message.

So, updated instructions:
1. Run GGGsetup. This will create GGGlide.
2. Run SSStumble (add mouse device) and then it will launch GGGlide.
3. Done!


Just noticed the error was when running the setup... :think:
I am not sure, I have not encountered this error before. But this is an issue with GGGsetup which you did not have previously right? On the first message box GGGSetup indicates the path that it will output the script is that the right directory? Could it be a permissions issue of the folder?
Can you download them again and try them on your Desktop maybe? I will make a small correction on GGGsetup (on something unrelated but helpful).
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

22 Jun 2018, 13:00

Hello,

I have tried with the files out of my "Program" folder (within my "Downloads" one on an other disk) and you know what ? IT WORKS ! :D

One note : we have to run each time both 'GGGlide.ahk' *and* 'SSStumble.ahk', so to let 2 links in the Windows StartUp menu seems to be the easier way to automate the process.
2018-06-22 (5).png
2018-06-22 (5).png (31.73 KiB) Viewed 3678 times
Thank you very much again for your efforts and this excellent job ! :bravo:

Best Regards,
Guy
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

22 Jun 2018, 13:39

CapGuy wrote:Hello,

I have tried with the files out of my "Program" folder (within my "Downloads" one on an other disk) and you know what ? IT WORKS ! :D

One note : we have to run each time both 'GGGlide.ahk' *and* 'SSStumble.ahk', so to let 2 links in the Windows StartUp menu seems to be the easier way to automate the process.
2018-06-22 (5).png

Thank you very much again for your efforts and this excellent job ! :bravo:

Best Regards,
Guy
Good news! 8-)
Just run SSStumble and after 5-10 seconds it will start GGGlide automatically, you do not need a shortcut for GGGlide (but all the files should be on the same working directory).
Btw, if you want to access the advanced parameters menu of GGGsetup launch it with Caps Lock on.
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

25 Jun 2018, 09:10

Hi, back again...
Not sure if I mentioned another project of mine that may be of interest to you - see AutoHotInterception in my signature. This will allow you RawInput-like subscribing to mouse delta information (from a specific device), but you can mutate it or even throw it away *before the OS sees it*.
Also, when you synthesize output using eg mouse_event, you simply do not see it come in again as input (Because AHI shows you what the driver sees), so you do not have to take measures to ignore what you are sending. You can also use AHI's send methods to send movement as a specific device, and again you do not see it come in again as input
User avatar
IOrot
Posts: 26
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse Pointer Momentum [v1.97.1](ergonomic/productivity enhancement)

28 Jun 2018, 11:18

evilC wrote:Hi, back again...
Not sure if I mentioned another project of mine that may be of interest to you - see AutoHotInterception in my signature. This will allow you RawInput-like subscribing to mouse delta information (from a specific device), but you can mutate it or even throw it away *before the OS sees it*.
Also, when you synthesize output using eg mouse_event, you simply do not see it come in again as input (Because AHI shows you what the driver sees), so you do not have to take measures to ignore what you are sending. You can also use AHI's send methods to send movement as a specific device, and again you do not see it come in again as input
Hello C! Always a pleasure to see you around !
It seems quite relevant, I will have a look. Thank you for bringing your project to my attention. :)
Did you happen to try out the latest GGGlide?

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: return, RussF and 108 guests