boppreh / keyboard

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

Problems when packing into *.exe by cx_freeze (5.0.2) #214

Open HuoJnx opened 6 years ago

HuoJnx commented 6 years ago

File: GUI_translator.zip

File_description: The whole program is within the zip. It's just a mini translator with a PyQt5 GUI. It can connect to Baidu translated API and translate the content in clipboard after pressing combination key "ctrl+c" by the help of this amazing module.

Problem_description: The program works well under the environment of python console(3.6) and Jupyter Notebook, but doesn't work after packing into .exe by cx_freeze(5.0.2). The problem is that after packing into .exe, It can't respond to the keyboard event when I press combination key "ctrl+c". I have searched for solution all night but nothing matched. Thank you for your attention.

realjohnward commented 5 years ago

Has any solution been found @HuoJnx ? I have the same issue

HuoJnx commented 5 years ago

Has any solution been found @HuoJnx ? I have the same issue

I'm so sorry, I don't know the solution. I just replaced this module with the inner hook module in PyQt5.@johnward-umensch

realjohnward commented 5 years ago

Thanks for your reply, @HuoJnx. I ended up finding a solution!

I just cloned the keyboard repo into my main path instead of using the pip installed version. It has been working fine ever since.

HuoJnx commented 5 years ago

@johnward-umensch Oops!! Thanks for your help! How did you come up with this? It heard amazing.

realjohnward commented 5 years ago

Just a lot of trial and error! @HuoJnx

HuoJnx commented 5 years ago

Oh, that's cool! Thanks for your guidance~@johnward-umensch