Is there a way to trigger a key command on a map change?

Moving from Deck to main map for instance causing a CTRL A to fire is that possible?