V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Leon6868
V2EX  ›  Python

如何在 PyQt5 窗口内禁止 win 键事件

  •  
  •   Leon6868 · 2020-06-12 20:11:22 +08:00 · 2142 次点击
    这是一个创建于 1412 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有任何方法可以做到吗?
    不用 PyQt5 也可以

    8 条回复    2020-06-13 18:59:50 +08:00
    Felldeadbird
        1
    Felldeadbird  
       2020-06-12 21:03:55 +08:00 via iPhone
    将 win 注册为全局热键,做一个空白打印?
    Leon6868
        2
    Leon6868  
    OP
       2020-06-12 22:16:22 +08:00
    @Felldeadbird 好像不行,user32.RegisterHotKey 不能单独注册 win 键
    Felldeadbird
        3
    Felldeadbird  
       2020-06-12 22:21:30 +08:00
    @Leon6868 我之前注册全局热键,是用 pyqtkeybind
    Leon6868
        4
    Leon6868  
    OP
       2020-06-12 22:36:38 +08:00
    @Felldeadbird 还是不行,我使用“keybinder.register_hotkey(window.winId(), "Win",win)”,无法调用
    ysc3839
        5
    ysc3839  
       2020-06-13 00:06:03 +08:00 via Android
    whi147
        6
    whi147  
       2020-06-13 16:26:21 +08:00 via iPhone
    写一个 cpp 的文件 c++注册键盘 hook,然后 python 调 cpp 内函数
    Leon6868
        7
    Leon6868  
    OP
       2020-06-13 17:30:43 +08:00
    @ysc3839 可以禁用 win 的组合键了,但这样似乎不可以禁止 ctrl+alt+del
    ysc3839
        8
    ysc3839  
       2020-06-13 18:59:50 +08:00 via Android
    @Leon6868 是的,是 Windows 故意限制的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5300 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:14 · PVG 16:14 · LAX 01:14 · JFK 04:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.