The node you are looking for is at Pitches - Separating key cancellations from key signature changes.