I'm trying to build a little python program using pygame that detects when the shift key is pressed but it isn't working it isn't printing the debug print that I put in there here is my code
while running:
screen.fill((0, 0, 0))
x, y = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.MOUSEBUTTONDOWN:
rectangle = "green"
if event.type == pygame.MOUSEBUTTONUP:
rectangle = "red"
if event.type == pygame.KEYDOWN:
if event.key == pygame.KMOD_SHIFT:
modshift = "down"
print("debug shift")
if event.key == pygame.KMOD_CTRL:
modctrl = "down"
if event.type == pygame.KEYUP:
if event.key == pygame.KMOD_SHIFT:
modshift = "up"