sys-botbase icon indicating copy to clipboard operation
sys-botbase copied to clipboard

setStick extremely slow to take effect

Open ariataylor96 opened this issue 3 years ago • 1 comments

First off - thank you so much for building this, I adore this library and it's helped me make some really fun projects. The base of one of those projects is building something that proxies controller input from a Linux PC to the Switch using sys-botbase. I've got everything working without any noticeable delay, except for the stick movement.

I've confirmed that I'm receiving stick events the moment they happen on my end and going through the socket immediately, but they take a few seconds to actually reflect on the switch. Buttons and d-pad functionality work great and are reflected instantaneously.

I believe this is because the library is trying to slide between stick values instead of jumping immediately? But I could be wrong.

ariataylor96 avatar Jun 01 '21 23:06 ariataylor96

I was wrong and the issue was more one of documentation. Moving an analog stick generates a lot of events very quickly, and with the sleep calls in the main loop/button loop, this translates to very real input lag.

Sending configure mainLoopSleepTime 0, configure buttonClickSleepTime 0, and configure keySleepTime 0 immediately after connecting made it much more responsive.

ariataylor96 avatar Jun 04 '21 21:06 ariataylor96