(direction, cursor_x, cursor_y, rect)
We have multiple candidate terminals. Pick the closest by cursor
    position
We have multiple candidate terminals. Pick the closest by cursor
    position
We have multiple candidate terminals . Pick the closest by cursor position
def get_nav_tiebreak(direction, cursor_x, cursor_y, rect):
    """We have multiple candidate terminals. Pick the closest by cursor
    position"""
    if direction in ['left', 'right']:
        return(cursor_y >= rect.y and cursor_y <= (rect.y + rect.height))
    elif direction in ['up', 'down']:
        return(cursor_x >= rect.x and cursor_x <= (rect.x + rect.width))
    else:
        raise ValueError('Unknown direction: %s' % direction)
def get_nav_tiebreak ( direction , cursor_x , cursor_y , rect ) : if direction in [ 'left' , 'right' ] : return ( cursor_y >= rect . y and cursor_y <= ( rect . y + rect . height ) ) elif direction in [ 'up' , 'down' ] : return ( cursor_x >= rect . x and cursor_x <= ( rect . x + rect . width ) ) else : raise ValueError ( 'Unknown direction: %s' % direction )