Python pygame.K_i() Examples

The following are 3 code examples of pygame.K_i(). 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: skinnedanimation.py    From renpy-shader with MIT License 6 votes vote down vote up
def update(self, frameNumber, editor):
        for event, pos in editor.context.events:
            if event.type == pygame.KEYDOWN:
                bone = editor.getActiveBone()
                key = event.key
                if key == pygame.K_i:
                    if bone:
                        if event.mod & pygame.KMOD_ALT:
                            if bone.name in self.frames[frameNumber].keys:
                                del self.frames[frameNumber].keys[bone.name]
                        else:
                            key = self.frames[frameNumber].getBoneKey(bone.name)
                            copyKeyData(bone, key)
                        self.dirty = True
                elif key == pygame.K_o:
                    if bone:
                        data = self.getBoneData(bone.name)
                        data.repeat = not data.repeat
                        self.dirty = True
                elif key == pygame.K_p:
                    if bone:
                        data = self.getBoneData(bone.name)
                        data.reversed = not data.reversed
                        self.dirty = True 
Example #2
Source File: keys_def.py    From launcher with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #3
Source File: pyint.py    From Pyint_Pixel-Painter with GNU General Public License v3.0 5 votes vote down vote up
def key_event_up(event):
    global penSize, undoed, holdingCTRL, colorScheme, selectedTool


    if event.key == pg.K_1:
        colorScheme = 1
    elif event.key == pg.K_2:
        colorScheme = 2

    if event.key == pg.K_e:
        selectedTool = 1
        B_Buttons[1].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False
    elif event.key == pg.K_b:
        selectedTool = 0
        B_Buttons[0].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False
    elif event.key == pg.K_g:
        selectedTool = 2
        B_Buttons[2].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False
    elif event.key == pg.K_i:
        selectedTool = 3
        B_Buttons[3].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False

    if event.key == pg.K_LCTRL:
        holdingCTRL = False

    if event.key == pg.K_SPACE:
        if holdingCTRL:
            g1.clean()
            undoed = True

    if event.key == pg.K_s:
        if holdingCTRL:
            shortcutPath = FileManager(1)
            SaveFile(g1, shortcutPath)

    if event.key == pg.K_z:
        if holdingCTRL:

            for i in range(g1.yCount):
                for j in range(g1.xCount):
                    if round == 1:
                        g1.change_color(j, i, g1.undoList[1][i][j])
                    if round == -1:
                        g1.change_color(j, i, g1.undoList[0][i][j])
            undoed = True