Monday, June 6, 2022

[SOLVED] The little loop runs too often

Issue

i have wrote a simple Phyton in AutoKey script. I expected the cursor runs one line down. But the cursor runs many 1000 lines down. That takes some minutes.

for i in range(0, 1): 
    keyboard.press_key('<down>')

i tried to uninstall other software that could maybe influence the keyboard negative. i uninstalled espanso ( https://espanso.org/install/ ) but it changes nothing.

The result is also visible in this live stream (german voice): https://youtu.be/r9QYQv5h2HU


Solution

The Down Key hangs permanently. The Loop was running correct. Its needet to release it manually by using keyboard.release key('<down>')

for i in range(0, 1): 
    keyboard.press_key('<down>')
    keyboard.release_key('<down>')


Answered By - SL5net
Answer Checked By - Robin (WPSolving Admin)