boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.8k stars 433 forks source link

keyboard.write write more than it should after a while #97

Open pvane opened 7 years ago

pvane commented 7 years ago

Hello everybody, I'm new here and hope that someone could help me. First of all I explain what my Pyhton3 program does.

My program reads the Title and Artist from an webradio and paste it into a chat room, so that everybody in the room can see what music is streaming.

I started the program with sudo rights on a raspberry pi. The first 3 - 5 Songs, everything is fine. After a while the "keyboard.write" command hang one or two characters behind the Songtitle or write only a few pieces from whole title. In my Terminalwindow I print the Variable before the keyboard.write command write it in the Chatroom. There is all ok - without shuffle Characters or only a peace of Title.

Is there a way to delete perhaps the cache of the keyboard.write command - or could it be com from the Character translating eg. UTF-8 ??? I hope someone could help me, because it's really a nice feature in our WebRadio Chatroom.

Thanks for help. Yours Peter

boppreh commented 7 years ago

Hmm, this is strange. keyboard.write keeps no cache; in linux it just writes data to special device files.

Can you make a small self-contained example so I can test on my Pi too?