Changeset 495:a5a57abd5472


Ignore:
Timestamp:
04/09/11 20:42:55 (12 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Rebase:
62626331346631393931303132306639303565626661323465386238356664356237636563393031
Message:

Allow K_SPACE wherever we allow K_RETURN.

Location:
skaapsteker
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/levelscene.py

    r454 r495  
    33from pygame.locals import (KEYDOWN, KEYUP, K_DOWN, K_ESCAPE, K_LEFT, K_RIGHT,
    44                           K_SEMICOLON, K_UP, K_c, K_j, K_p, K_q, K_x, K_z,
    5                            K_v, K_k, K_RETURN, SRCALPHA)
     5                           K_v, K_k, K_RETURN, K_SPACE, SRCALPHA)
    66
    77import pygame
     
    8484
    8585        self._quit_keys = set([K_q, K_ESCAPE])
    86         self._restart_keys = set([K_x, K_z, K_RETURN])
     86        self._restart_keys = set([K_x, K_z, K_RETURN, K_SPACE])
    8787
    8888        self._fast_key_map = {
  • skaapsteker/menuscene.py

    r479 r495  
    11import pygame
    2 from pygame.locals import K_ESCAPE, K_q, K_UP, K_DOWN, K_RETURN, KEYDOWN, QUIT
     2from pygame.locals import K_ESCAPE, K_q, K_UP, K_DOWN, K_RETURN, K_SPACE, KEYDOWN, QUIT
    33
    44from .data import load_image
     
    5353            elif ev.key == K_UP:
    5454                self._selected -= 1
    55             elif ev.key == K_RETURN:
     55            elif ev.key in [K_RETURN, K_SPACE]:
    5656                self.selected(self._selected, self._options[self._selected])
    5757
  • skaapsteker/widgets/bubble.py

    r471 r495  
    11"""Widget for in-level dialogue / speech bubbles."""
    22
    3 from pygame.locals import (KEYDOWN, K_UP, K_p, K_q, K_x, K_z, K_RETURN, SRCALPHA)
     3from pygame.locals import (KEYDOWN, K_UP, K_p, K_q, K_x, K_z, K_RETURN, K_SPACE, SRCALPHA)
    44import pygame.draw
    55import pygame
     
    3535
    3636    def dispatch(self, ev):
    37         if ev.type == KEYDOWN and ev.key == K_RETURN:
     37        if ev.type == KEYDOWN and ev.key in [K_RETURN, K_SPACE]:
    3838            CloseDialog.post(None)
    3939
  • skaapsteker/widgets/text.py

    r257 r495  
    22
    33import pygame
    4 from pygame.locals import KEYDOWN, K_UP, K_DOWN, K_RETURN
     4from pygame.locals import KEYDOWN, K_UP, K_DOWN, K_RETURN, K_SPACE
    55
    66from ..widgets import Widget
     
    141141            elif ev.key == K_DOWN:
    142142                self.selected += 1
    143             elif ev.key == K_RETURN:
     143            elif ev.key in [K_RETURN, K_SPACE]:
    144144                for callback in self.callbacks:
    145145                    callback(self.selected, self.options[self.selected][1])
     
    182182            elif ev.key == K_DOWN:
    183183                self.selected += 1
    184             elif ev.key == K_RETURN:
     184            elif ev.key in [K_RETURN, K_SPACE]:
    185185                for callback in self.callbacks:
    186186                    callback(self.selected, self.options[self.selected][1])
Note: See TracChangeset for help on using the changeset viewer.