微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

当文件转换为 .exe

如何解决当文件转换为 .exe

我正在尝试检测鼠标额外按钮(Button.X1 和 Button.X2)。当文件是 .py 时,我能够实际看到按钮被按下。但是,当我将它作为 .exe 运行时,这似乎不起作用。它在鼠标和键盘侦听器中都有打印语句,但不提供任何输出。我也尝试过使用 py2exe 和 pyinstaller 进行转换。

def on_press(key):
    print(key)

def on_release(key):
    print(key)

def on_click(x,y,button,pressed):
    print(button)

class Keylogger(Thread):
    def run(self):
        with keyboardListener(on_press=on_press,on_release=on_release) as listener:
            listener.join()


class MouseLogger(Thread):
    def run(self):
        with mouseListener(on_click=on_click) as listener:
            listener.join()

我尝试过使用非常便宜的鼠标和 Corsair 25 美元的鼠标。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。