Pygame program that can get keyboard input with caps

Posted by None on Stack Overflow See other posts from Stack Overflow or by None
Published on 2010-04-19T23:27:28Z Indexed on 2010/04/19 23:33 UTC
Read the original article Hit count: 346

Filed under:
|
|
|
|

I have a Pygame program that needs text input. The way it does this is to get keyboard input and when a key is pressed it renders that key so it is added to the screen. Essentially it acts like a text field. The problem is, when you hold shift it doesn't do anything. I relize this is because the program ignores shift input and instead writes the text if it's number is under 128. I have thought of setting a variable when shift is pressed then capitalizing if it was true, but string capitalization only woks on letters, not things like numbers or semicolons. Is there maybe a number I can add to the ascii number typed to modify it if shift is pressed, or something else?

© Stack Overflow or respective owner

Related posts about python

Related posts about pygame