It probably is the key switch.
Could be a bad starter solenoid (return spring not strong enough to disengage) Could be a bad ignition switch (does it release if you shift to "Drive"?)
how do you replace ignition switch on a 1992 Chevy cavalier 2.2 4 cylinder
yes
Either the keyswitch has failed or the contacts inside the starter have fused.
The signal for the starter originates from the key switch, I would start there.
bad starter, or switch, or a short in the wiring. hope it helps. duboff
Probably a stuck solenoid.
if the starter is not spinning and the truck motor is running
If you are talking about the ignition cylinder lock, the part where the key goes: Turn the switch to "ON". There is a square pin on the front of the switch (side closest to dash). Push the pin in and pull the cylinder out. Mine was locked so I had to drill it out.
it does not switch between cng and gas all the switch does is changes the dash board fuel switch to show how much gas in in your tank when you are running on CNG
If the starter is whining while the engine is running at an idle you have a problem with the ignition switch or the starter solenoid is stuck. The starter should not be engaged while the engine is running unless you are holding the key over on the start position.
If the truck is manual. There are a couple of place to check. A bad ignition switch, bad clutch interlock switch or a bad starter relay. If it is an automatic. The selector switch could be bad.