本文整理汇总了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()