Mercurial > rinkhals
comparison gamelib/gameboard.py @ 528:04975aa3ec70
Alt also sets groups, because jerith has a weird OS setup.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 19:56:08 +0000 |
parents | f59cb047d08f |
children | c1f14fa35d30 |
comparison
equal
deleted
inserted
replaced
527:f59cb047d08f | 528:04975aa3ec70 |
---|---|
1 import random | 1 import random |
2 | 2 |
3 import pygame | 3 import pygame |
4 from pygame.locals import MOUSEBUTTONDOWN, MOUSEMOTION, KEYDOWN, K_UP, K_DOWN, \ | 4 from pygame.locals import MOUSEBUTTONDOWN, MOUSEMOTION, KEYDOWN, K_UP, K_DOWN, \ |
5 K_LEFT, K_RIGHT, KMOD_SHIFT, K_0, K_1, K_2, K_3, K_4, K_5, K_6, K_7, \ | 5 K_LEFT, K_RIGHT, KMOD_SHIFT, K_0, K_1, K_2, K_3, K_4, K_5, K_6, K_7, \ |
6 K_8, K_9, KMOD_CTRL, KEYUP | 6 K_8, K_9, KMOD_CTRL, KMOD_ALT, KEYUP |
7 from pgu import gui | 7 from pgu import gui |
8 | 8 |
9 import tiles | 9 import tiles |
10 import icons | 10 import icons |
11 import constants | 11 import constants |
825 self.tvw.move_view(constants.TILE_DIMENSIONS[0], 0) | 825 self.tvw.move_view(constants.TILE_DIMENSIONS[0], 0) |
826 return True | 826 return True |
827 elif e.type == KEYDOWN and e.key in \ | 827 elif e.type == KEYDOWN and e.key in \ |
828 [K_0, K_1, K_2, K_3, K_4, K_5, K_6, K_7, K_8, K_9]: | 828 [K_0, K_1, K_2, K_3, K_4, K_5, K_6, K_7, K_8, K_9]: |
829 mods = pygame.key.get_mods() | 829 mods = pygame.key.get_mods() |
830 if mods & KMOD_CTRL: | 830 if (mods & KMOD_CTRL) or (mods & KMOD_ALT): |
831 # store current selection | 831 # store current selection |
832 self.stored_selections[e.key] = self.selected_chickens[:] | 832 self.stored_selections[e.key] = self.selected_chickens[:] |
833 else: | 833 else: |
834 self.restore_selection(self.stored_selections.get(e.key, [])) | 834 self.restore_selection(self.stored_selections.get(e.key, [])) |
835 elif e.type == KEYDOWN: | 835 elif e.type == KEYDOWN: |