I am trying to use the SkyWriter Hat along with pyautogui to control a web browser. However with the SkyWriter software actively looking for events the pyautogui software is screwed. This leads to many duplicate letters in the output stream that pyautogui produces. Without the SkyWriter software initialized pyautogui works perfectly.
Is there a way to turn on and off the SkyWriter software actively looking for events? Otherwise it is a project killer.
There is quite a tight deadline on this task so help would be appreciated.
I am using the @skywriter.flick() function from the test example, that is all plus the import statements.
import skywriter
import signal
That is all.
Without the imports the pyautogui typewriter function works fine. With them it is slow and many times there are multiple repeats of the same character.
I’m surprised I didn’t catch this sooner, it looks like the method responsible for polling ( _do_poll) gets no sleep, this will mean it’ll run in an brutal, hog-all-the-resources loop to the detriment of anything else you want to do.
If you want to try hacking it, you should be able to just drop in a time.sleep(0.001) ( or whatever value is practical for you ) into the _do_poll method itself.
I’m going to update the library on pip very soon, because this is a completely bonkers oversight that really needs squashing fast! But first… due diligence and testing whatnot!
Update: I’ve now pushed version 0.0.6 which should hopefully fix your problem. Try: