Sounds like the IGNITION SOLENOID. The key closes/turn on the ignition solenoid. The ignition solenoid, then supplies all those circuits that only work with the key on.
Locate the ignition solenoid and check it with a voltmeter. Should take under 2 minutes to test.
Ignition off= 12+VDC to only one of the two large lugs of the solenoid.
Ignition on= same 12+ VDC voltage reading at both large lugs.
If not, check for 12+ VDC at the small terminal (from the ignition switch). If two small terminals, one will be ground, the other from ignition switch. If only one small terminal, ground is through the body of the solenoid.
You can also test by verifying which small (or only) terminal comes from the ignition switch. Disconnect the wire. Use a small jumper wire (carrying very little current, so small wire just fine) from the large lug with power from the chassis battery. You should hear a sharp "click" and power should be passed through to the other large terminal.