jo-ruether / led_table

LED table
5 stars 0 forks source link

Enable keyboard input #17

Open jo-ruether opened 4 years ago

jo-ruether commented 4 years ago

When starting the bot, the input tends to have a relatively high delay for reasons to be investigated. For testing purposes, keyboard inputs would be a good alternative.

arjunsarin commented 4 years ago

I experience a similiar delay and I assume that this is due to the system architecture. The ping from my computer to the table was about 150ms and maybe that explains the delay.

The second option of course involves the Postman class. Maybe there is some bottleneck in threading.

arjunsarin commented 4 years ago

Retrieving the caller / sender when a message is send causes that delay! I assume that loading python libraries takes sometime when calling first. As we don't use sender information at the moment, I just removed that feature (which turned out to be more a bug).

https://github.com/jo-ruether/table/blob/03a8dd533268acc88e0560d1b600c7f6fdc5ad25/table/Postman.py#L27

So the delay is resolved by 03a8dd533268acc88e0560d1b600c7f6fdc5ad25.

arjunsarin commented 4 years ago

However, direct keyboard input may be desirable anyway, @jo-ruether?

arjunsarin commented 4 years ago

https://pynput.readthedocs.io/en/latest/#