推荐学习书目
› 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 · Jun 12, 2020 · 2965 views
    This topic created in 2355 days ago, the information mentioned may be changed or developed.

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

    8 replies  •  2020-06-13 18:59:50 +08:00
    Felldeadbird
    Felldeadbird
    Jun 12, 2020 via iPhone
    1
    将 win 注册为全局热键,做一个空白打印?
    Leon6868
    Leon6868
    OP
    Jun 12, 2020
    2
    @Felldeadbird 好像不行,user32.RegisterHotKey 不能单独注册 win 键
    Felldeadbird
    Felldeadbird
    Jun 12, 2020
    3
    @Leon6868 我之前注册全局热键,是用 pyqtkeybind
    Leon6868
    Leon6868
    OP
    Jun 12, 2020
    4
    @Felldeadbird 还是不行,我使用“keybinder.register_hotkey(window.winId(), "Win",win)”,无法调用
    ysc3839
    ysc3839
    Jun 13, 2020 via Android
    5
    whi147
    whi147
    Jun 13, 2020 via iPhone
    6
    写一个 cpp 的文件 c++注册键盘 hook,然后 python 调 cpp 内函数
    Leon6868
    Leon6868
    OP
    Jun 13, 2020
    7
    @ysc3839 可以禁用 win 的组合键了,但这样似乎不可以禁止 ctrl+alt+del
    ysc3839
    ysc3839
    Jun 13, 2020 via Android
    8
    @Leon6868 是的,是 Windows 故意限制的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3050 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 05:17 · PVG 13:17 · LAX 21:17 · JFK 00:17
    ♥ Do have faith in what you're doing.