![]() "Time passed (a): " str(tickTime/tick)) "Time passed (r): " str(round(tickTime/tick, 2)) "\n" Too slow by " str(tickTime - tick) "\n" Here is the full code if needed: import keyboard I think it is because the first is constantly checking if I am typing 'p' or not, which is the cause of the lag, but how else can I write something like that? I cannot use while run = 1: because eventually it gives me an error since I am holding down 'a' and the variable 'start' does not have an assigned value any more. If I replace this with something like this: It does not cause keyboard lag. I've narrowed the issue down to this: while True: The problem is that this program lags my keyboard/causes delay in keyboard presses. So I am learning python and I am trying to create a code that detects the time between pressing "space" and "a" for something in Minecraft. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |