Dave says that you should not connect such electric circuits directly to the CMOS inputs of the controller.

Better is to use an optocoupler and your switch be in series with the source, limit R and the opto LED. The optocoupler output could then be connected to the PIC input, having an electric isolation from any external EMC source.

Ioannis