本文整理匯總了Python中pyglet.window.key.X屬性的典型用法代碼示例。如果您正苦於以下問題:Python key.X屬性的具體用法?Python key.X怎麽用?Python key.X使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類pyglet.window.key
的用法示例。
在下文中一共展示了key.X屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: on_key_press
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def on_key_press(self, symbol, modifiers):
if symbol == key.X:
self.w.maximize()
print 'Window maximized.'
elif symbol == key.N:
self.w.minimize()
print 'Window minimized.'
示例2: on_key_press
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def on_key_press(self, symbol, modifiers):
delta = 20
if modifiers & key.MOD_SHIFT:
delta = -delta
if symbol == key.X:
self.width += delta
elif symbol == key.Y:
self.height += delta
self.w.set_size(self.width, self.height)
print 'Window size set to %dx%d.' % (self.width, self.height)
示例3: on_key_press
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def on_key_press(self, symbol, modifiers):
if symbol == key.N:
self.w.set_minimum_size(self.width, self.height)
print 'Minimum size set to %dx%d.' % (self.width, self.height)
elif symbol == key.X:
self.w.set_maximum_size(self.width, self.height)
print 'Maximum size set to %dx%d.' % (self.width, self.height)
示例4: on_key_press
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def on_key_press(self, symbol, modifiers):
if symbol == key.N:
self.w.set_minimum_size(self.width, self.height)
print('Minimum size set to %dx%d.' % (self.width, self.height))
elif symbol == key.X:
self.w.set_maximum_size(self.width, self.height)
print('Maximum size set to %dx%d.' % (self.width, self.height))
示例5: on_key_press
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def on_key_press(self, symbol, modifiers):
if symbol == key.X:
self._select_next_key()
示例6: _update_question
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def _update_question(self):
self.question = """Please press:
{} ({})
Press the X key if you do not have this motion key.
Press Esc if test does not pass.""".format(key.motion_string(self.chosen_key),
key.symbol_string(self.chosen_key))
self._render_question()
示例7: test_show_hide
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import X [as 別名]
def test_show_hide(self):
"""Test the on_show and on_hide events."""
self.question = ('Please trigger hide and show this window again.\n'
'You can do this by:\n'
'- Minimize and restore the window\n'
'- On OS X show and hide using Command+H or the dock context menu\n'
'\n'
'Test passes after doing this 4 times.')
self.window_size = 700, 200
self._test_main()