Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
games
krank
krank-0.7-pause.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File krank-0.7-pause.patch of Package krank
--- src/Input.py 2008-06-13 04:44:00.000000000 +0400 +++ src/Input.py 2009-03-14 22:47:23.000000000 +0300 @@ -20,6 +20,7 @@ self.exit = False self.pause = False + self.unfocused_pause = False # target pos self.targetpos = k.world.rect.center @@ -61,14 +62,29 @@ def handleEvents (self): for event in pygame.event.get(): + if event.type == pygame.ACTIVEEVENT: + if event.state == 2: + if event.gain: + if self.unfocused_pause: + self.pause = False + self.unfocused_pause = False + else: + if not self.pause: + self.pause = True + self.unfocused_pause = True + if event.type == pygame.QUIT: sys.exit() # ---------------------------------------------------------------------- KEYS elif event.type == pygame.KEYDOWN: # ------------------------------------------------------------------ pause - if event.key == 32: + if event.key in [ 32, 19, 112]: + self.unfocused_pause = False self.pause = not self.pause else: - if self.pause: self.pause = False + if event.key in [ 27, 113, 275, 276, + 105, 114, 115, 49, 50, 51, 280, 281, 19, 112]: + if self.pause: + self.pause = False # ------------------------------------------------------------------ exit if event.key == 113 and event.mod == pygame.KMOD_LMETA: self.onExit()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor