zeth / inputs

Cross-platform Python support for keyboards, mice and gamepads
BSD 3-Clause "New" or "Revised" License
269 stars 87 forks source link

1ms delay to data loop. #75

Open phuein opened 5 years ago

phuein commented 5 years ago

Overloads the CPU otherwise. The While loop should at least take 1ms.

phuein commented 5 years ago

65 Discussion

jagprog5 commented 5 years ago

👍

gaafiz commented 4 years ago

Is this going to be merged?

barrettford commented 3 years ago

So... we gonna merge this?

SpotlightKid commented 3 years ago

This is not the right way to fix this, IMO. The sleep does not belong in the _do_iter method. Just put in the loop in your own code where you iterate over the InputDevice instance.

zeth commented 3 years ago

This is not the right way to fix this, IMO. The sleep does not belong in the _do_iter method. Just put in the loop in your own code where you iterate over the InputDevice instance.

This is what I thought. At least we should use asyncio or something so the user has control.

The original platform this was aimed at was Raspberry Pi then I tested it on Linux, Mac and Windows on thirty input devices.

(BTW If the delay is really needed on Windows then any solutions should only be on Windows, which to be fair I think this is. I don't feel I know enough yet to make changes.)