windows - Python: Keyboard input without repeat delay -
for don't know, repeat delay slight pause between, when holding down key, letter first appearing , repeating. might useful feature when typing, when start write games, becomes annoying. example when need move character; move tiny bit, pause, , start move again. tkinter code:
ball = canvas.create_rectangle(50, 50, 100, 100) def move(): canvas.move(ball, 0, 3) canvas.bind_all("<space>", move) if space pressed, ball move down 3 pixels, pause, , start moving normally. wondering if there way avoid pause, example module reads directly keyboard, , not windows-processed keyboard. know possible "cheat" by, example, automatically running function when expect delay occur; sadly inaccurate , can result in choppy movement. in advance
Comments
Post a Comment