added a new module that creates a sdl window and gets a key from the user
this can be used so that hotkeys and input can be controlled from the GUI directly this module however adds an additional depenency to the program: pygame i might just rewrite this in c so gfceu doesn't have another dependency
This commit is contained in:
parent
ac2abd91f1
commit
2db6590fbd
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
import pygame
|
||||
import sys
|
||||
from pygame.locals import *
|
||||
|
||||
pygame.init()
|
||||
width = 300
|
||||
height = 100
|
||||
screen = pygame.display.set_mode((width, height))
|
||||
pygame.display.set_caption("Press any key. . .")
|
||||
|
||||
while 1:
|
||||
for event in pygame.event.get():
|
||||
if event.type == KEYDOWN:
|
||||
print event.key
|
||||
sys.exit(event.key)
|
||||
|
Loading…
Reference in New Issue