__init__.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:FightstickDisplay 作者: calexil 项目源码 文件源码
def set_exclusive_keyboard(self, exclusive=True):
        # http://developer.apple.com/mac/library/technotes/tn2002/tn2062.html
        # http://developer.apple.com/library/mac/#technotes/KioskMode/

        # BUG: System keys like F9 or command-tab are disabled, however 
        # pyglet also does not receive key press events for them.

        # This flag is queried by window delegate to determine whether 
        # the quit menu item is active.
        self._is_keyboard_exclusive = exclusive

        if exclusive:
            # "Be nice! Don't disable force-quit!" 
            #          -- Patrick Swayze, Road House (1989)
            options = NSApplicationPresentationHideDock | \
                      NSApplicationPresentationHideMenuBar | \
                      NSApplicationPresentationDisableProcessSwitching | \
                      NSApplicationPresentationDisableHideApplication
        else:
            options = NSApplicationPresentationDefault

        NSApp = NSApplication.sharedApplication()
        NSApp.setPresentationOptions_(options)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号