Skip to content

Commit

Permalink
Increased polling interval to 250 times/sec
Browse files Browse the repository at this point in the history
Since Windows timers can't do fine-grained resolution, an interval of 4 ms
seemed to be a good balance between polling a lot to reduce input latency
and not taxing the CPU too much.
  • Loading branch information
Brian Kendall committed Oct 1, 2015
1 parent 0699347 commit 2e02d61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion controllerremapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void ControllerRemapper::run()
pollTimer->moveToThread(this);
connect(pollTimer, SIGNAL(timeout()), this, SLOT(poll()), Qt::DirectConnection);
pollTimer->setTimerType(Qt::PreciseTimer);
pollTimer->setInterval(1000 / kPollingCyclesPerSecond);
pollTimer->setInterval(4);

if (enabled) {
pollTimer->start();
Expand Down
1 change: 0 additions & 1 deletion controllerremapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// The following is a value that an XInput axis is guaranteed never to have, and
// is therefore safe to use as a flag indicating an unset value:
#define kAxisUnset -100000
#define kPollingCyclesPerSecond 150

enum {
kUp = 0,
Expand Down

0 comments on commit 2e02d61

Please sign in to comment.