本文整理匯總了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'))