简体   繁体   中英

Keyboard stops working after using Python Keyboard Library

I made a script that utilizes the keyboard library in Python. I only have the following lines that utilize this library.

keyboard.wait('alt')
keyboard.write('some string', delay=0.01)

The script works but after running it my keyboard stops working after. I am unable to find any other resources about this problem mainly because the library shares the same name as the device that is having problems.

Removing the write line fixes this problem.

This is working without the line

keyboard.write('some string', delay=0.01)

because you are waiting for alt key to be pressed

the above line is stopping your program instead of keyboard.wait. Try to wrap it in a loop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM