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


Python pygame.K_PAGEUP属性代码示例

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


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

示例1: _map_keys

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_PAGEUP [as 别名]
def _map_keys(self):
        key_map = self.io.key_map

        key_map[imgui.KEY_TAB] = pygame.K_TAB
        key_map[imgui.KEY_LEFT_ARROW] = pygame.K_LEFT
        key_map[imgui.KEY_RIGHT_ARROW] = pygame.K_RIGHT
        key_map[imgui.KEY_UP_ARROW] = pygame.K_UP
        key_map[imgui.KEY_DOWN_ARROW] = pygame.K_DOWN
        key_map[imgui.KEY_PAGE_UP] = pygame.K_PAGEUP
        key_map[imgui.KEY_PAGE_DOWN] = pygame.K_PAGEDOWN
        key_map[imgui.KEY_HOME] = pygame.K_HOME
        key_map[imgui.KEY_END] = pygame.K_END
        key_map[imgui.KEY_DELETE] = pygame.K_DELETE
        key_map[imgui.KEY_BACKSPACE] = pygame.K_BACKSPACE
        key_map[imgui.KEY_ENTER] = pygame.K_RETURN
        key_map[imgui.KEY_ESCAPE] = pygame.K_ESCAPE
        key_map[imgui.KEY_A] = pygame.K_a
        key_map[imgui.KEY_C] = pygame.K_c
        key_map[imgui.KEY_V] = pygame.K_v
        key_map[imgui.KEY_X] = pygame.K_x
        key_map[imgui.KEY_Y] = pygame.K_y
        key_map[imgui.KEY_Z] = pygame.K_z 
开发者ID:swistakm,项目名称:pyimgui,代码行数:24,代码来源:pygame.py

示例2: KeyDown

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_PAGEUP [as 别名]
def KeyDown(self,event):
        """
        if event.key == pygame.K_PAGEUP:
            self.EasingAllPageLeft()
            #self.SwapAndShow()
        if event.key == pygame.K_PAGEDOWN:
            self.EasingAllPageRight()
            #self.SwapAndShow()
        """
        
        if event.key == pygame.K_t:
            self.DrawRun()
            self.SwapAndShow()
        
        """
        if event.key == CurKeys["Space"]:
            self._CounterScreen.Draw()
            self._CounterScreen.SwapAndShow()
            self._CounterScreen.StartCounter()
        """ 
        ## leave rest to Pages
        current_page_key_down_cb = getattr(self._CurrentPage,"KeyDown",None)
        if current_page_key_down_cb != None:
            if callable( current_page_key_down_cb ):
                self._CurrentPage.KeyDown(event)
                
        self._LastKey = event.key 
开发者ID:clockworkpi,项目名称:launcher,代码行数:29,代码来源:main_screen.py

示例3: update

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_PAGEUP [as 别名]
def update(self, events):
        updated = False
        for event in events:  # type: pygame.event.Event
            if event.type == pygame.KEYDOWN and self._orientation == 1 \
                    and event.key in (pygame.K_PAGEUP, pygame.K_PAGEDOWN):
                direction = 1 if event.key == pygame.K_PAGEDOWN else -1
                if self._scroll(direction * self._page_step):
                    self.change()
                    updated = True

            elif self.mouse_enabled and event.type == pygame.MOUSEMOTION and self.scrolling:
                if self._scroll(event.rel[self._orientation]):
                    self.change()
                    updated = True

            elif self.mouse_enabled and event.type == pygame.MOUSEBUTTONDOWN:
                if event.button in (4, 5) and self._orientation == 1:
                    # Vertical bar: scroll down (4) or up (5)
                    direction = -1 if event.button == 4 else 1
                    if self._scroll(direction * self._single_step):
                        self.change()
                        updated = True
                else:
                    # The _slider_rect origin is related to the widget surface
                    if self._slider_rect.move(*self._rect.topleft).collidepoint(event.pos):
                        # Initialize scrolling
                        self.scrolling = True

                    elif self._rect.collidepoint(*event.pos):
                        # Moves towards the click by one "page" (= slider length without pad)
                        srect = self._slider_rect.move(*self._rect.topleft)
                        pos = (srect.x, srect.y)
                        direction = 1 if event.pos[self._orientation] > pos[self._orientation] else -1
                        if self._scroll(direction * self._page_step):
                            self.change()
                            updated = True

            elif self.mouse_enabled and event.type == pygame.MOUSEBUTTONUP:
                if self.scrolling:
                    self.scrolling = False
                    updated = True

        return updated 
开发者ID:ppizarror,项目名称:pygame-menu,代码行数:45,代码来源:scrollbar.py


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