Python pygame.K_LSHIFT Examples

The following are 3 code examples of pygame.K_LSHIFT(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pygame , or try the search function .
Example #1
Source File: battle.py    From universalSmashSystem with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #2
Source File: example-2.py    From python-examples with MIT License 5 votes vote down vote up
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 
Example #3
Source File: example-1.py    From python-examples with MIT License 5 votes vote down vote up
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