def METHOD_NAME(self, key):
    """Process a key up event and change switches accordingly."""
    action = self.active_keys.pop(key, None)
    if action:
        if action.startswith('-'):
            self.send_switch(state=1, name=action[1:])
        else:
            self.send_switch(state=0, name=action)