本文整理汇总了Python中pyglet.window.key.V属性的典型用法代码示例。如果您正苦于以下问题:Python key.V属性的具体用法?Python key.V怎么用?Python key.V使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pyglet.window.key
的用法示例。
在下文中一共展示了key.V属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_key_press
# 需要导入模块: from pyglet.window import key [as 别名]
# 或者: from pyglet.window.key import V [as 别名]
def on_key_press(self, symbol, modifiers):
if symbol == key._1:
self.apply = not self.apply
with self.shader:
self.shader.uniformi("iApply", self.apply)
if symbol == key._2:
self.hyperbolic = not self.hyperbolic
with self.shader:
self.shader.uniformi("iHyperbolic", self.hyperbolic)
if symbol == key._3:
self.elliptic = not self.elliptic
with self.shader:
self.shader.uniformi("iElliptic", self.elliptic)
if symbol == key.V and (modifiers & key.LCTRL):
self.switch_video()
if symbol == key.ENTER:
self.save_screenshot()
if symbol == key.ESCAPE:
pyglet.app.exit()
示例2: on_key_press
# 需要导入模块: from pyglet.window import key [as 别名]
# 或者: from pyglet.window.key import V [as 别名]
def on_key_press(self, symbol, modifiers):
"""
Keyboard interface.
"""
if symbol == key.ENTER:
self.save_screenshot()
if symbol == key.ESCAPE:
pyglet.app.exit()
if symbol == key.SPACE:
self.clear_blank_window()
if symbol == key.P:
self.use_random_palette()
if symbol == key.S and not modifiers:
self.use_next_species()
if symbol == key.S and (modifiers & key.LCTRL):
self.save_config()
if symbol == key.O and (modifiers & key.LCTRL):
self.require_config_input()
if symbol == key.V and (modifiers & key.LCTRL):
self.switch_video()
示例3: on_key_press
# 需要导入模块: from pyglet.window import key [as 别名]
# 或者: from pyglet.window.key import V [as 别名]
def on_key_press(self, symbol, modifiers):
if symbol == key.V:
vsync = not self.w1.vsync
self.w1.set_vsync(vsync)
print 'vsync is %r' % self.w1.vsync
示例4: on_key_press
# 需要导入模块: from pyglet.window import key [as 别名]
# 或者: from pyglet.window.key import V [as 别名]
def on_key_press(self, symbol, modifiers):
if symbol == key.V:
visible = (modifiers & key.MOD_SHIFT)
self.w.set_mouse_visible(visible)
print 'Mouse is now %s' % (visible and 'visible' or 'hidden')
示例5: on_key_press
# 需要导入模块: from pyglet.window import key [as 别名]
# 或者: from pyglet.window.key import V [as 别名]
def on_key_press(self, symbol, modifiers):
if symbol == key.V:
visible = (modifiers & key.MOD_SHIFT)
self.w.set_mouse_visible(visible)
print('Mouse is now %s' % (visible and 'visible' or 'hidden'))