pygame keys keep pressing

Solutions on MaxInterview for pygame keys keep pressing by the best coders in the world

showing results for - "pygame keys keep pressing"
Milo
03 Feb 2016
1while not done:
2    for e in event.get():
3        if e.type == KEYDOWN:
4            keys = key.get_pressed()
5            if e.type == QUIT or keys[K_ESCAPE]:
6                done = True
7            if keys[K_DOWN]:
8                print "DOWN"
9
Braylon
23 Aug 2018
1while not done:
2    for e in event.get():
3        if e.type == KEYDOWN:
4            keys = key.get_pressed()
5            if e.type == QUIT or keys[K_ESCAPE]:
6                done = True
7            while keys[K_DOWN]:
8                print "DOWN"
9                event.get()
10                keys = key.get_pressed()
11