The D2EV-5GL22 Switch was discontinued in March 1998. The factory stopped production at that date. There is no switch compatible with D2EV, because D2EV used a special “Hall effect operation”. Internally they operate with an Electronic circuit, not a mechanical contact. Maybe there is another solution to your problem; the best replacement (Mechanically) is the D3V series. They have same dimensions and levers. Best replacement is the D3V-015M-1*3 type.
There are 3 types of terminals available for the D3V-015M-1*3 type, the * is code for the connection:
A: Solder/quick-connect terminals (#187); C2: Quick-connect terminals (#187);C: Quick-connect terminals (#250).
Please see the D3V series data sheet for details (B103-E1-02):
So the above switch a good mechanical solution, naturally electrically they are different. D3V has a mechanical contact, but it can switch micro-load, at 5VDC it can switch 1mA (Guaranteed). At such small load, the contact does not "arc" and the microprocessor should not have a problem with that.
The connection of D2EV needs to be changed so that D3V can be used. The D2EV is connected like below:
The Resistor of 4k7 creates the low 1mA current at 5VDC. The Capacitor eliminates noise and contact bounce.