Simply modify the kpd.c example that CCS supplies in the examples folder.
It's very well documented, easy to reduce into a 2by2 kpd.
It might be easier for you to just have 4 switches attached to PortB high nibble,use an ISR,decode which switch was pressed(code for that is in the CCS Help files).
Without knowing which PIC we probably can't help further.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum