'Given two events check if the `key_name` field in content changed
from not matching `public_value` to doing so.
For example, check if `history_visibility` (`key_name`) changed from
`shared` to `world_readable` (`public_value`).
Returns:
None if the field in the events either both match `public_value`
or if neither do, i.e. there has been no change.
True if it didnt match `public_value` but now does
False if it did match `public_value` but now doesn\'t'

@defer.inlineCallbacks
def _get_key_change(self, prev_event_id, event_id, key_name, public_value):

    prev_event = None
    event = None
    if prev_event_id:
        prev_event = (yield self.store.get_event(prev_event_id, allow_none=True))
    if event_id:
        event = (yield self.store.get_event(event_id, allow_none=True))
    if ((not event) and (not prev_event)):
        logger.debug('Neither    event    exists:    %r    %r', prev_event_id, event_id)
        defer.returnValue(None)
    prev_value = None
    value = None
    if prev_event:
        prev_value = prev_event.content.get(key_name)
    if event:
        value = event.content.get(key_name)
    logger.debug('prev_value:    %r    ->    value:    %r', prev_value, value)
    if ((value == public_value) and (prev_value != public_value)):
        defer.returnValue(True)
    elif ((value != public_value) and (prev_value == public_value)):
        defer.returnValue(False)
    else:
        defer.returnValue(None)
