How can the RB interrupt be used to detect a button press?
The RB interrupt will happen when there is any change (input or output) on pins B4-B7. There is only one interrupt and the PIC does not tell you which pin changed. The programmer must determine the change based on the previously known value of the port. Furthermore, a single button press may cause several interrupts due to bounce in the switch. A debounce algorithm will need to be used.