当前位置: 首页>>代码示例>>Python>>正文


Python pygame.K_k方法代码示例

本文整理汇总了Python中pygame.K_k方法的典型用法代码示例。如果您正苦于以下问题:Python pygame.K_k方法的具体用法?Python pygame.K_k怎么用?Python pygame.K_k使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pygame的用法示例。


在下文中一共展示了pygame.K_k方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _handle_keyboard_shortcuts

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_k [as 别名]
def _handle_keyboard_shortcuts(self):
        while self._running:
            event = pygame.event.wait()
            if event.type == pygame.KEYDOWN:
                # If pressed key is ESC quit program
                if event.key == pygame.K_ESCAPE:
                    self._print("ESC was pressed. quitting...")
                    self.quit()
                if event.key == pygame.K_k:
                    self._print("k was pressed. skipping...")
                    self._player.stop(3)
                if event.key == pygame.K_s:
                    if self._playbackStopped:
                        self._print("s was pressed. starting...")
                        self._playbackStopped = False
                    else:
                        self._print("s was pressed. stopping...")
                        self._playbackStopped = True
                        self._player.stop(3) 
开发者ID:adafruit,项目名称:pi_video_looper,代码行数:21,代码来源:video_looper.py

示例2: handle_event

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_k [as 别名]
def handle_event(self, event: pygame.event.EventType) -> None:
        """
        Handle pygame events for moving and zooming in the displayed area.

        :param event: a pygame event
        """
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_l:
                self.scaling *= 1 / self.SCALING_FACTOR
            if event.key == pygame.K_o:
                self.scaling *= self.SCALING_FACTOR
            if event.key == pygame.K_m:
                self.centering_position[0] -= self.MOVING_FACTOR
            if event.key == pygame.K_k:
                self.centering_position[0] += self.MOVING_FACTOR 
开发者ID:eleurent,项目名称:highway-env,代码行数:17,代码来源:graphics.py

示例3: SetXYABButtons

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_k [as 别名]
def SetXYABButtons(mode):
    if mode == "snes":
        GameShell["Y"] = pygame.K_u
        GameShell["X"] = pygame.K_i
        GameShell["B"] = pygame.K_j
        GameShell["A"] = pygame.K_k
    else:
        GameShell["X"] = pygame.K_u
        GameShell["Y"] = pygame.K_i
        GameShell["A"] = pygame.K_j
        GameShell["B"] = pygame.K_k 
开发者ID:clockworkpi,项目名称:launcher,代码行数:13,代码来源:keys_def.py


注:本文中的pygame.K_k方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。