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

Post your working scripts, libraries and tools
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

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

16 Aug 2017, 17:49

GGGlide v1.97.1

GGGlide is an ergonomic and productivity feature for touchpad users.

The GGGlide function is reminiscent of the behavior of the Synaptics touchpad setting 'Momentum' (or the more familiar two-finger inertial scrolling but for pointing).
One quick flick of the finger on the TouchPad surface can move the cursor across the entire computer screen. Momentum reduces the repetitive motion and fatigue associated with moving the cursor long distances.

It is a great feature which now is available to any touchpad/trackpad ! :bravo:

Depending on the forcefulness and direction of the finger flick the cursor glides on the screen an equivalent distance.
After a flick of the finger, your movements inertia is "transferred" to the pointer which continues its trajectory with the same speed and direction of your finger, effectively gliding through your desktop. The gliding pointers' physics include friction and hence it will slow down over time eventually stopping. After some tries it is easy to estimate intuitively where the pointer will stop, vastly improving touchpad ergonomics by drastically reducing the total distance of finger/hand travel required. It also works very well with multiple monitor setups.

After a short 'flick' of the finger on the touchpad surface the pointer starts gliding. While gliding:
  • If the user interacts with the position of the pointer (e.g. moves the pointer/mouse) the glide is interrupted.
  • If the user presses down the left click the glide is interrupted (e.g. use tap-to-click to click/stop the gliding pointer at specific point).
  • If the user releases the left click the glide is interrupted (e.g. hold down left click, initiate glide, release left click to stop).
  • If the pointer encounters the screen edge, the glide is interrupted (when starting at the edge you can still glide on the screens' borders).
  • The user can perform another pointer glide while still gliding (e.g. while gliding vertically, flick horizontally for horizontal glide).
  • Any mouse input received will interrupt the current glide (scrolling, right click, etc).
  • The pointer will decelerate until it stops if none of the above occurs.

I have a Logitech T650 touchpad and this has been a feature I had been sorely missing and which I have enriched over time. Apart from AHK I guess another alternative would have been to implement some sort of driver.

The script functions mostly satisfactory but I would greatly appreciate and value any input, suggestions or improvements!


Instructions

The script below will prompt you for the speed of the pointer above which a glide will be performed. Then, it will create and run GGGlide. You can run the GGG setup as many times required or every time you want to change the glide activation speed. A higher value means you need to move your pointer faster before it glides and vice versa. You will need to experiment with different values due to hardware variability (e.g. my laptop Synaptics touchpad on highest sensitivity is good at 1700 but the T650 on Win drivers fares sublime at 390). The setup dialog will have as default speed your current GGGlide value for easier tweaking.
Optionally, GGGlide can change the OS pointer settings of Windows to the recommended defaults at every script launch.
Do not use the GGGlide script created on one PC on other machines. It will not work as expected. Note the glide parameters and then rerun the GGGSetup on the new machine (or copy the ggglide.ini file).

Code: [Select all] [Expand] [Download] (GGGsetup.ahk)GeSHi © Codebox Plus


SSStumble v0.01

(GGGlide Add-On)

For those who work using both mice and touchpads and which prefer disabling GGGlide while "mousing" there is SSStumble!


Instructions

Download and run on the same directory with your trusty GGGlide. Upon launch you can select pointing devices where GGGlide gliding will be disabled by SSStumble. You can launch SSStumble and wait for the message box to expire and GGGlide will be launched soon after. All settings are preserved in the GGGlide ".ini" file.

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). This is evident only when triggering a pause to GGGlide via a hotkey.
- SSStumble only works with the new version of GGGlide v1.97.1 and above. Any older version will not work.
- SSStumble must be running in the background in order to monitor the device which you are using.
- It can distinguish between identical pointing devices operating simultaneously (e.g. two mice or two trackpads which are of the same make).
- Saved devices need to be added again if they are plugged in a different USB port.

Code: [Select all] [Expand] [Download] (SSStumble.ahk)GeSHi © Codebox Plus



General Notes:
  • Any mouse settings changes can be reverted painlessly by doing the following: 'Start>Mouse>Pointer Options' you will see a "Motion" box. There you can revert to any settings. If you untick "enhanced pointer precision" and move the speed slider exactly at the middle (6th line) you will replicate the GGGlide settings.
  • Added moving average filtering
  • R.I.P. readability (single line code)
  • Default Sleep was highly unreliable for such short intervals
  • Did not notice any overall performance hit by timeBeginPeriod setting
  • It has not been tested with a traditional mouse but it should still work (you may have to lift your mouse from the surface as to simulate a finger flick).

Issues:
Non-detection of "tap to click" left click when using Logitech trackpad drivers (works fine with default Win trackpad drivers for Logitech trackpad).
Last edited by IOrot on 22 Jun 2018, 11:15, edited 48 times in total.
GeekDude
Posts: 827
Joined: 02 Oct 2013, 22:13

Re: GGGlide - Mouse cursor momentum for touchpad (or any pointing device)

17 Aug 2017, 22:18

Great work! My only Windows system I have on hand is virtual, so I can't actually use this script, but it sounds pretty nice. One thing I noticed is that you don't seem to tweak the SetBatchLines setting. The default has AHK automatically performing a 10ms (effectively 15-16ms) every 10ms, which can limit the fluidity of scripts that do motion.

I use SetBatchLines, -1 as one of only two lines in my default script template (the other being #NoEnv). This disables the feature entirely and makes the script run at full speed. You can still insert your own sleep commands at opportune moments if you need them.
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse cursor momentum for touchpad (or any pointing device)

20 Aug 2017, 07:45

Thanks for the tip ! :D I had missed that particular setting and I did see improvement (although Critical supposedly alters that anyway?). :wtf:
It was rather helpful because I stumbled upon a slew of other things I had totally missed which made the script much more consistent and smooth. Cheers, GeekDude !
User avatar
evilC
Posts: 4235
Joined: 27 Feb 2014, 12:30

Re: GGGlide - Mouse cursor momentum for touchpad (or any pointing device)

21 Aug 2017, 04:35

I have a version of this which uses mouse delta instead of cursor position - it will work in games (eg first person shooters) as well as on the desktop.
https://autohotkey.com/boards/viewtopic.php?t=8439

I also have a version which is partially backed by C# code, so it is a bit more CPU efficient: https://autohotkey.com/boards/viewtopic ... 62#p152062
Also see the MicroTimer library that this version uses, it will give you more accurate, lower CPU usage timers than QPX - it will quite happily do 1ms ticks.
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse cursor momentum for touchpad (or any pointing device)

22 Aug 2017, 12:41

evilC wrote:I have a version of this which uses mouse delta instead of cursor position - it will work in games (eg first person shooters) as well as on the desktop.
https://autohotkey.com/boards/viewtopic.php?t=8439

I also have a version which is partially backed by C# code, so it is a bit more CPU efficient: https://autohotkey.com/boards/viewtopic ... 62#p152062
Also see the MicroTimer library that this version uses, it will give you more accurate, lower CPU usage timers than QPX - it will quite happily do 1ms ticks.

Wow… Wish I knew this sooner it would have been much easier.!! :headwall: Impressive to say the least..! Plus, the GUI is very appealing. Thanks for bringing your work to my attention. :clap:

Haven’t looked at the C# yet but I tested briefly the RollMouse script. Unfortunately it does not perform exactly as expected on my setup (win7 x64, Core 2 Duo 2.45Ghz). Don’t know if this is by design/use case or due to my touchpad.

I have adjusted the MoveFactor and MoveThreshold to match my speeds and I do get a roll/glide to occur, which is what you would expect (constant velocity with no deceleration, infinite displacement). Then, if I perform a finger flick while gliding, lets say perpendicular to the direction of travel, often enough although my mouse movement is registered (the pointer moves visibly in perpendicular fashion) the current glide is not interrupted albeit shifted by the pointer movement.

Would that be because of the MOVE_BUFFER_SIZE ?
Might it be caused by the Sleep in this part?

Code: [Select all] [Download] GeSHi © Codebox Plus

while (this.State == this.STATE_ROLLING){

; Send output

DllCall("user32.dll\mouse_event", "UInt", 0x0001, "UInt", this.LastMove.x, "UInt", this.LastMove.y, "UInt", 0, "UPtr", 0)

; Wait for a bit (allow real mouse movement to be detected, which will turn off roll)

Sleep % this.RollFreq

}


Something felt off while trying it and I have perused the code a little further but cannot experiment currently so I will go forward with some of my thoughts even if nobody asked for them! I understand that RollMouse is intended for FPS games using mice but I will be looking at it from a desktop use standpoint with a touchpad.

I think your approach of the xy movement threshold makes its use somewhat inconsistent especially when around the lowest activation speeds.
It ignores the actual resultant displacement vector of x and y and treats them independently which means you may need to perform up to 40% larger movement (e.g. at 45 degrees angles) to reach the thresholds when not moving strictly on the x or y axis. You can end up with an actual delta larger than either the x or y delta component threshold but still have no activation.
More importantly this also affects the direction vector of your glide, presumably this further interacts with the smoothing you perform based on discarding input smaller than MOVE_BUFFER_SIZE as relatively small perpendicular vectors can have a noticeable effect in direction.

When you add up the last deltas at LastMove you essentially integrate the pointers’ change in displacement over time. Assuming a constant sampling rate this would provide the total displacement over some time period. I cannot find any such time period within the gliding context (but I am rather ignorant of the nature of the delta movement capture mechanics). The summing will also zero out displacements with both negative and positive readings, which makes the gliding less responsive.

Is there a specific way/methodology to check CPU usage or should I prop up taskmangr?

As I mentioned previously I am aware this was not necessarily designed with desktop use in mind and I apologise for neat picking your script but I wouldn’t have if it weren’t so interesting and informative. :D :D To be honest I cannot be sure I fully understood your code so hopefully I did not misinterpret it. :oops:
User avatar
evilC
Posts: 4235
Joined: 27 Feb 2014, 12:30

Re: GGGlide - Mouse cursor momentum for touchpad (or any pointing device)

23 Aug 2017, 08:48

Sounds like you have a pretty good understanding of ways to make this work, maybe even better than me. TBH maths is not my strongest suit ;)
The old (AHK implementation) of RollMouse is not hugely reliable TBH, and I would like to improve the technique - would you like to work together to take what we have and improve it?
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

Re: GGGlide - Mouse cursor momentum for touchpad (or any pointing device)

30 Aug 2017, 14:02

I think that it will be easy to change most of the things I mentioned so I can help you out with my suggestions. That said, my script above currently works pretty well even within games (tested strategy games, I own no FPS). It is very responsive in my system and I see no high CPU load issues. I am also planning to test some further optimizations and add some additional physics in the gliding. I would be glad to help with anything that comes to my attention but as is I see no incentive for switching and re-implementing the GGGlide features in RollMouse.
CapGuy

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

22 Nov 2017, 09:48

Hell(o) 10rot,

Thanks a lot for this simple and efficient AHK script : tested and approved !

The best for a just-user like me could be to have a simple graphic user interface (say : to run a kind of assistant-screens could be perfect) to set up easily the speed of cursor, duration of momentum (setting of inertia), and so on...

But already as this, it will let me happy as I can use my Logitech Touchpad almost as easy and useful as my Synaptics ones !

(for those who could think this function is not needed : no mistake, only one try with a trackpad and you will not want to do without !)

Best Regards,
Guy
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

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

25 Nov 2017, 10:08

Hell(o),

One thing which could be very useful is just to do the cursor stops when we touch the pad without moving the finger touching.
For now we need to move the finger while touching pad, but when we only touch it without moving our finger the cursor continues on its own momentum, say it is not possible to stop it just touching the pad without moving the finger.
This behavior could be very interesting, because if now we can continue the cursor movement where we need to "send" it, it is more difficult to just stop it where we need.

Do you thing you could implement just this easily ?

Best Regards,
Guy
User avatar
boiler
Posts: 2371
Joined: 21 Dec 2014, 02:44

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

25 Nov 2017, 12:10

Thanks for sharing this. Works well on my Surface Laptop. I found that adjusting the speed threshold to around 400 works better for me so I have to purposely flick it and it doesn't keep running when I am just making small movements.

I understand that there may not be much reason for you to spend time to add a GUI interface or work with evilC to incorporate your techniques into RollMouse, but I'll note my interest in that for what it's worth.
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

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

03 Jan 2018, 14:35

boiler wrote:Thanks for sharing this. Works well on my Surface Laptop. I found that adjusting the speed threshold to around 400 works better for me so I have to purposely flick it and it doesn't keep running when I am just making small movements.

I understand that there may not be much reason for you to spend time to add a GUI interface or work with evilC to incorporate your techniques into RollMouse, but I'll note my interest in that for what it's worth.


Hi Boiler ! Glad you found it useful ! Unfortunately the Windows OS mouse settings (enhanced precision/acceleration and speed) are in the way and can change drastically the speed curve of the pointer and consequently mess with GGGlide speed thresholds. I have implemented a fix for the issue by setting the Windows mouse settings to values which do not interfere with user input so the script settings should be better calibrated or at least have a sounder basis. The Windows mouse settings can always be adjusted back to any old settings through Windows Mouse Properties. This does not address any sensitivity differences from the various trackpads so tinkering might be needed in many cases.
I agree that a GUI interface would be nice and the current script makes tinkering with the speed thresholds an absolute pain. Unfortunately, I am still working on eliminating lag and I might be getting paranoid but even adding variables at some places instead of actual values seem to slow down the script noticeably.
Let me know if you prefer the new version. You are the second person using it afaik, so it's definitely worth something ! :D
I will try and add some obvious labels above lines with values which might help out with that issue.
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

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

03 Jan 2018, 15:54

CapGuy wrote:Hell(o),

One thing which could be very useful is just to do the cursor stops when we touch the pad without moving the finger touching.
For now we need to move the finger while touching pad, but when we only touch it without moving our finger the cursor continues on its own momentum, say it is not possible to stop it just touching the pad without moving the finger.
This behavior could be very interesting, because if now we can continue the cursor movement where we need to "send" it, it is more difficult to just stop it where we need.

Do you thing you could implement just this easily ?

Best Regards,
Guy


Hi CapGuy ! Thank you for your kind words ! :D A GUI interface will eventually come but as I am changing how things operate I need some time to settle that first. You are asking for a way of terminating the glide just by tapping/touching but not moving your finger on the touchpad. This can be accomplished if you can enable "tap to click" at your touchpad settings so when you tap/touch the trackpad it registers a click and stops the gliding without the need to move the pointer. Btw, I am not running the Setpoint Logitech drivers or application with my trackpad. I am using the default drivers provided by Windows when you plug in the USB wireless adapter.
I have two more simple but life saving ergonomics scripts specifically for touchpads, one of which taps in the gesture shortcuts for the Logitech. Will create a separate post for them at some point.
CapGuy
Posts: 8
Joined: 22 Nov 2017, 11:52

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

04 Jan 2018, 02:37

Hi IOrot,
Thanks a lot for your answer and your tips. Unfortunately I have to use the Logitech drivers because I use both the Touchpad and a mouse in the same time (3D stuff request it). Also nowadays Windows 10 does not ask me which driver I want, and it install Logitech ones automatically, and with 'tap to click' activated the behavior is the same (cursor does not stop when we just touch the pad without any movement) :-/
Anyway no matter, it is just a question of habits :)
Thanks again for your very useful software !
Cordially,
Guy
User avatar
boiler
Posts: 2371
Joined: 21 Dec 2014, 02:44

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

04 Jan 2018, 12:09

Hi IOrot. I do find it very useful, and I have it running on my laptop all the time. If I turn it off, it's like the mouse cursor is stuck in the mud. This should be default operation for touchpads. Great job!

Because it's working so well and because the new version will change my Windows mouse settings, I'm a little hesitant to try the new version. I know you said I could change the settings back, though. Which settings does it change so I can note what they are so I can change them back if I have to? Actually, I think I'd rather use code that doesn't change the mouse settings as long as it's working well, but if it is noticeably better, I might use it. I'm not seeing any lag or any other issues on mine, so I'm not sure how it could be better.

It would be nice if the 2-finger drag to scroll on my touchpad also worked like this, where momentum would keep it scrolling. I made an attempt at that but wasn't happy with it yet, so I wrote another one that acts more like the middle mouse button click approach with a standard mouse. I may post that when I refine it some, but a momentum-based scroll would be much preferred. Have you ever looked at doing anything with that?
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

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

04 Jan 2018, 12:52

CapGuy wrote:Hi IOrot,
Thanks a lot for your answer and your tips. Unfortunately I have to use the Logitech drivers because I use both the Touchpad and a mouse in the same time (3D stuff request it). Also nowadays Windows 10 does not ask me which driver I want, and it install Logitech ones automatically, and with 'tap to click' activated the behavior is the same (cursor does not stop when we just touch the pad without any movement) :-/
Anyway no matter, it is just a question of habits :)
Thanks again for your very useful software !
Cordially,
Guy


Yes for some bizarre reason the left click from the "tap to click" option from the Logitech drivers registers differently than a normal left click and my script cannot detect it, so the glide does not stop. Also the trackpad behaves differently with the Logitech drivers, seems like there is more processing done on the touch input before it is translated to on-screen pointer movement. Both issues are fixed with the default Win driver on Win 7, I have no Win 10 machine so I am not sure how to help. Maybe if someone knows how to detect the Logitech left click I could fix it because it is an essential feature and others may have the same problem. As a temporary workaround I believe if you press hard enough on the touchpad it should perform a left click which should stop the glide. In any case, I will eventually tweak the momentum settings to make it easier to target a spot on screen using the glide, as for now I was only aiming to make it efficient at traveling large distances.

CapGuy wrote:Hi IOrot. I do find it very useful, and I have it running on my laptop all the time. If I turn it off, it's like the mouse cursor is stuck in the mud. This should be default operation for touchpads. Great job!

Because it's working so well and because the new version will change my Windows mouse settings, I'm a little hesitant to try the new version. I know you said I could change the settings back, though. Which settings does it change so I can note what they are so I can change them back if I have to? Actually, I think I'd rather use code that doesn't change the mouse settings as long as it's working well, but if it is noticeably better, I might use it. I'm not seeing any lag or any other issues on mine, so I'm not sure how it could be better.

It would be nice if the 2-finger drag to scroll on my touchpad also worked like this, where momentum would keep it scrolling. I made an attempt at that but wasn't happy with it yet, so I wrote another one that acts more like the middle mouse button click approach with a standard mouse. I may post that when I refine it some, but a momentum-based scroll would be much preferred. Have you ever looked at doing anything with that?


Well I may have been overly cautious with my warnings about the OS mouse changes. I does not modify anything within the registry or similar. If you go at Start>Mouse>Pointer Options you will see a "Motion" box. If you untick "enhanced pointer precision" and move the speed slider exactly at the middle (6th line) you can replicate my settings. So maybe download the new one ver 1.6 comment out 'Gosub, MouseSettings' and see if it suits you. I have also changed the gliding slightly but the physics part will be changing with each version as I am not happy with the gliding response yet. Fortunately, my T650 already has this inertial scrolling feature but I do not know if it is possible to detect gestures.

Very glad to hear people find it useful :)
User avatar
boiler
Posts: 2371
Joined: 21 Dec 2014, 02:44

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

04 Jan 2018, 14:47

IOrot wrote:Well I may have been overly cautious with my warnings about the OS mouse changes. I does not modify anything within the registry or similar. If you go at Start>Mouse>Pointer Options you will see a "Motion" box. If you untick "enhanced pointer precision" and move the speed slider exactly at the middle (6th line) you can replicate my settings. So maybe download the new one ver 1.6 comment out 'Gosub, MouseSettings' and see if it suits you. I have also changed the gliding slightly but the physics part will be changing with each version as I am not happy with the gliding response yet.
Thanks, I'll check it out then.

IOrot wrote:Fortunately, my T650 already has this inertial scrolling feature but I do not know if it is possible to detect gestures.
Wish mine did that. I tried seeing if the two-finger drag gesture itself might register as a keystroke using one of the scripts that shows key presses on an on-screen display, and it apparently doesn't (although I can detect the wheel ups and downs that result if I have it set for that), even though things like 3-finger and 4-finger taps do register as a key combination. Detecting the wheel ups and downs didn't seems like the best method for determining speed.
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

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

05 Mar 2018, 12:36

boiler wrote:
IOrot wrote:Well I may have been overly cautious with my warnings about the OS mouse changes. I does not modify anything within the registry or similar. If you go at Start>Mouse>Pointer Options you will see a "Motion" box. If you untick "enhanced pointer precision" and move the speed slider exactly at the middle (6th line) you can replicate my settings. So maybe download the new one ver 1.6 comment out 'Gosub, MouseSettings' and see if it suits you. I have also changed the gliding slightly but the physics part will be changing with each version as I am not happy with the gliding response yet.
Thanks, I'll check it out then.

IOrot wrote:Fortunately, my T650 already has this inertial scrolling feature but I do not know if it is possible to detect gestures.
Wish mine did that. I tried seeing if the two-finger drag gesture itself might register as a keystroke using one of the scripts that shows key presses on an on-screen display, and it apparently doesn't (although I can detect the wheel ups and downs that result if I have it set for that), even though things like 3-finger and 4-finger taps do register as a key combination. Detecting the wheel ups and downs didn't seems like the best method for determining speed.


Well you could possibly:
detect the wheel ups/downs to enable a "scrolling mode" where you could use the pointers vertical displacement to scroll an equivalent amount (like middle-click on
Firefox). Then wheel up/down again to exit mode. Btw, there is an updated version of GGGlide, much smoother and with sane defaults.
User avatar
IOrot
Posts: 23
Joined: 16 Aug 2017, 15:33

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

05 Mar 2018, 12:39

CapGuy wrote:Hi IOrot,
Thanks a lot for your answer and your tips. Unfortunately I have to use the Logitech drivers because I use both the Touchpad and a mouse in the same time (3D stuff request it). Also nowadays Windows 10 does not ask me which driver I want, and it install Logitech ones automatically, and with 'tap to click' activated the behavior is the same (cursor does not stop when we just touch the pad without any movement) :-/
Anyway no matter, it is just a question of habits :)
Thanks again for your very useful software !
Cordially,
Guy



Changed the way the pointer slows down, let me know if it suits you any better.
User avatar
evilC
Posts: 4235
Joined: 27 Feb 2014, 12:30

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

05 Mar 2018, 13:19

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] [Download] GeSHi © Codebox Plus

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.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: teadrinker and 19 guests