[Solved] How to allow caps in this input box program for pygame?


If you change the corresponding code to:

elif inkey <= 127:
    if pygame.key.get_mods() & KMOD_SHIFT or  pygame.key.get_mods() & KMOD_CAPS: # if shift is pressed  or caps is on
        current_string.append(chr(inkey).upper()) # make string uppercase
    else:
        current_string.append(chr(inkey)) # else input is lower 

That should work.

If you want more info on keyboard modifier states look here

1

solved How to allow caps in this input box program for pygame?