def interpretkeyevent(keyEvent):
    key = keyEvent.key
    if (key >= 32 and key < 127) or key in (ord('\n'), ord('\r'), ord('\t')):
        caps = bool(keyEvent.mod & KMOD_CAPS)
        shift = bool(keyEvent.mod & KMOD_LSHIFT or keyEvent.mod & KMOD_RSHIFT)
        char = chr(key)
        if char.isalpha() and (caps ^ shift):
            char = char.upper()
        elif shift and char in _shiftchars:
            char = _shiftchars[char]
        return char
    return None # None means that there is no printable character corresponding to this keyEvent
Returns the character represented by the pygame.event.Event object in keyEvent. This makes adjustments for the shift key and capslock.
dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py/interpretkeyevent