Use Xinput API without using a loop Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Peter Njeim

Use Xinput API without using a loop  Topic is solved

21 Feb 2018, 15:50

Hello, I've been trying to make a script for the Xbox One controller to use its joystick as a mouse. I found many here on the forums, and it only worked in the script window, and failed when in any other window. I found a solution online to use certain drivers and the solution actually worked, however it made the 2 analog triggers under one axis, so I found another newer driver that separated the 2 analog sticks and also fixed the previous issue. However, the Xbox controller no longer had xinput support, so I ditched this solution and reinstalled the normal drivers that come with the OS. I found Lexikos's Xinput API and used that, it does indeed work in all windows (and if run as admin it also works in admin windows).

The only issue I have with it is that the example given uses a loop. I made it so that my analog triggers scroll up and down, and that my left analog stick moves the cursor. However, when both are done at the same time (analog stick is not centered and analog trigger is held down) my mouse cursor becomes choppy, and changing the sleep to 0 doesn't change this behaviour (everything is faster, but it still becomes half speed when both are being used) and also -1 and 0 sleep make my CPU usage go up, so I don't want that. I was trying to make a timer and hotkeys so that they could run on separate threads, but I just can't figure it out.

Is it possible to make loops multi-threaded? Is it possible to not use a loop when using Lexikos's Xinput API? Any help would be gratefully appreciated.

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

Return to “Ask For Help”

Who is online

Users browsing this forum: Bill, scriptor2016, Sylvenia and 80 guests