'Key release event handler and validator'

def on_key_release(self, event):

    if self.active:
        key = (event.key or u'')
        for (state, modifier) in self.state_modifier_keys.items():
            if (modifier in key):
                self.state.discard(state)
        self._on_key_release(event)
