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

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

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