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)
评论列表
文章目录