Created
July 2, 2022 17:10
-
-
Save AlexRasch/a3da45bc3c97633ac3dc22c42f994304 to your computer and use it in GitHub Desktop.
Mouse Distance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POINT currentMousePosition; | |
POINT previousMousePosition; | |
GetCursorPos(&previousMousePosition); | |
double mouseDistance = 0; | |
while (true) | |
{ | |
GetCursorPos(¤tMousePosition); | |
mouseDistance += sqrt( | |
pow(currentMousePosition.x - previousMousePosition.x, 2) + | |
pow(currentMousePosition.y - previousMousePosition.y, 2) | |
); | |
// Convert and print distance | |
// | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment