# HG changeset patch # User Simon Cross # Date 1302041973 -7200 # Node ID 0ad313ec564d3670ca93903730f4772cea00238d # Parent 8d45715c587da9adac8c59445b4f212360adf082 Set key repeating. diff -r 8d45715c587d -r 0ad313ec564d skaapsteker/__main__.py --- 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: diff -r 8d45715c587d -r 0ad313ec564d skaapsteker/constants.py --- 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