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
NullBooleanField shouldn't throw a validation error when given a value
dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py/interpretkeyevent--crossover with--dataset/ETHPy150Open django/django/tests/model_fields/test_booleanfield.py/ValidationTest.test_nullbooleanfield_blank