本文整理汇总了Python中pygame.K_LSHIFT属性的典型用法代码示例。如果您正苦于以下问题:Python pygame.K_LSHIFT属性的具体用法?Python pygame.K_LSHIFT怎么用?Python pygame.K_LSHIFT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pygame
的用法示例。
在下文中一共展示了pygame.K_LSHIFT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: debugLoop
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_LSHIFT [as 别名]
def debugLoop(self):
self.draw()
pygame.display.update()
try:
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.exit_status = 1
self.debug_mode = False
if event.type == pygame.KEYDOWN:
if (event.key == pygame.K_LSHIFT or event.key == pygame.K_RSHIFT):
self.debug_mode = False
elif event.key == pygame.K_TAB:
self.debug_console.set_trace() #Drop into the console
elif event.key == pygame.K_LEFT:
self.cameraX = -5
elif event.key == pygame.K_RIGHT:
self.cameraX = 5
elif event.key == pygame.K_UP:
self.cameraY = -5
elif event.key == pygame.K_DOWN:
self.cameraY = 5
elif event.key == pygame.K_z:
self.zoomVal = 0.01
elif event.key == pygame.K_x:
self.zoomVal = -0.01
elif event.type == pygame.KEYUP:
if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
self.cameraX = 0
elif event.key == pygame.K_UP or event.key == pygame.K_DOWN:
self.cameraY = 0
elif event.key == pygame.K_z or event.key == pygame.K_x:
self.zoomVal = 0
for cont in self.controllers:
cont.getInputs(event)
self.stage.moveCamera(self.cameraX,self.cameraY)
self.stage.zoomCamera(self.zoomVal)
except bdb.BdbQuit:
pass
示例2: handle_event
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_LSHIFT [as 别名]
def handle_event(self, event):
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
self.speed_x -= 1
elif event.key == pygame.K_RIGHT:
self.speed_x += 1
elif event.key == pygame.K_UP:
self.speed_y -= 1
elif event.key == pygame.K_DOWN:
self.speed_y += 1
elif event.key == pygame.K_LSHIFT:
self.move_delay = 10
elif event.type == pygame.KEYUP:
if event.key == pygame.K_LEFT:
self.speed_x += 1
elif event.key == pygame.K_RIGHT:
self.speed_x -= 1
elif event.key == pygame.K_UP:
self.speed_y += 1
elif event.key == pygame.K_DOWN:
self.speed_y -= 1
elif event.key == pygame.K_LSHIFT:
self.move_delay = 200