Bit Masking

P18F4550:
there are 10 keys in total, thats alot of if's ...

Ten in fact.