Mercurial > skaapsteker
changeset 166:0ad313ec564d
Set key repeating.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Wed, 06 Apr 2011 00:19:33 +0200 |
parents | 8d45715c587d |
children | f7fb2ee24c70 |
files | skaapsteker/__main__.py skaapsteker/constants.py |
diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/skaapsteker/__main__.py Wed Apr 06 00:09:56 2011 +0200 +++ b/skaapsteker/__main__.py Wed Apr 06 00:19:33 2011 +0200 @@ -9,6 +9,7 @@ from . import options from .constants import SCREEN, FREQ, BITSIZE, CHANNELS, BUFFER, DEBUG +from .constants import KEY_REPEAT_DELAY_MS, KEY_REPEAT_INTERVAL_MS from .engine import Engine from .levelscene import LevelScene from .menuscene import MenuScene @@ -54,6 +55,7 @@ #pygame.display.set_icon(pygame.image.load( # data.filepath('icons/nine_tales24x24.png'))) pygame.display.set_caption("Nine Tales") + pygame.key.set_repeat(KEY_REPEAT_DELAY_MS, KEY_REPEAT_INTERVAL_MS) engine = Engine() if level is not None:
--- a/skaapsteker/constants.py Wed Apr 06 00:09:56 2011 +0200 +++ b/skaapsteker/constants.py Wed Apr 06 00:19:33 2011 +0200 @@ -7,6 +7,9 @@ CHANNELS = 2 # 1 == mono, 2 == stereo BUFFER = 1024 # audio buffer size in no. of samples +KEY_REPEAT_DELAY_MS = 250 +KEY_REPEAT_INTERVAL_MS = 50 + DEBUG = True EPSILON = 1e-10