keyboard icon indicating copy to clipboard operation
keyboard copied to clipboard

PyQt crashes when keyboard.send() is used

Open CodePidgy opened this issue 4 years ago • 2 comments
trafficstars

I have a button that links to print_func, which uses keyboard.send() to simulate keyboard presses elsewhere. I have noticed that keyboard.write() works just fine, but using keyboard.send() crashes the app (with no error output of any kind)

def print_func(self):
        keyboard.send(self.data_tree.selectedItems()[0].text(3)) # crashes
        # keyboard.write(self.data_tree.selectedItems()[0].text(3))

Any help or advice would be appreciated

CodePidgy avatar Nov 02 '21 15:11 CodePidgy

In Windows write and send use different syscalls, which may explain the difference.

I can't think of a concrete reason of why adding PyQt6 should lead to a crash, but Qt itself is fairly invasive. Can you try the latest version on the master branch to see if the bug still happens? There have been slight improvements to the Windows syscalls stability that are not in a release yet.

boppreh avatar Nov 02 '21 16:11 boppreh

So I downloaded the master branch and ran setup.py install and all went well, however, it made things worse. Using the latest master branch makes it crash in both cases instead of only when using keyboard.send(). I also downgraded from PyQt6 to PyQt5 to see if that would help, and it didn't, but now I'm still using PyQt5

CodePidgy avatar Nov 03 '21 08:11 CodePidgy