def getkey(window):
    """Get a keypress from the window.

    @return keycode, character  - character will be None if there is no match
    """
    key = window.getch()
    try:
        char = chr(key)
    except ValueError:
        char = None
    return key, char
