本文整理匯總了Python中pyglet.window.key.PAGEDOWN屬性的典型用法代碼示例。如果您正苦於以下問題:Python key.PAGEDOWN屬性的具體用法?Python key.PAGEDOWN怎麽用?Python key.PAGEDOWN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類pyglet.window.key
的用法示例。
在下文中一共展示了key.PAGEDOWN屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: on_key_release
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import PAGEDOWN [as 別名]
def on_key_release(symbol, modifiers):
global player
global bigScreen
global smallScreen
if symbol == key.SPACE:
player.jump()
if symbol == key.PAGEUP:
if smallScreen == True:
glScalef(2.0, 2.0, 2.0)
window.set_size(window.width * 2, window.height * 2)
smallScreen = False
bigScreen = True
if symbol == key.PAGEDOWN:
if bigScreen:
glScalef(0.5, 0.5, 0.5)
window.set_size(window.width / 2 , window.height /2)
smallScreen = True
bigScreen = False
# Handle mouse presses
示例2: on_key_press
# 需要導入模塊: from pyglet.window import key [as 別名]
# 或者: from pyglet.window.key import PAGEDOWN [as 別名]
def on_key_press(symbol, modifiers):
"""
This handler processes keyboard commands that
control the simulation
"""
if symbol == key.BACKSPACE or symbol == key.SLASH:
print('RESET')
env.reset()
env.render('pyglet', view=view_mode)
return
if symbol == key.ESCAPE:
env.close()
sys.exit(0)
if symbol == key.UP:
step(env.actions.move_forward)
elif symbol == key.DOWN:
step(env.actions.move_back)
elif symbol == key.LEFT:
step(env.actions.turn_left)
elif symbol == key.RIGHT:
step(env.actions.turn_right)
elif symbol == key.PAGEUP or symbol == key.P:
step(env.actions.pickup)
elif symbol == key.PAGEDOWN or symbol == key.D:
step(env.actions.drop)
elif symbol == key.ENTER:
step(env.actions.done)