import re


def is_api_cloudflare_input_key(prog, inp, api):
    """Test input for Cloudflare key and set in the api object if so.

    If the input is a key input ('key:...') then set the key in the
    'api' object to it.

    Args:
        prog (State): don't remove me because this function is looped over
            with other functions that do take this argument and use it.
        inp (str): input to check.
        api (ApiCloudflare): the api object to set.

    Returns:
        bool: 'True' if key in 'api' was set to 'inp', 'False' if not.
    """
    if re.match(r'key:\w+$', inp):
        api.key = inp[4:]
        return True
    return False