If I remember correctly, the kbhit() function looks to see if there is a character in the UART that is connected to the keyboard.
If that is the case, then the easiest solution is to know (from your design) which UART is connected to the keyboard and to look at the status registers to see if there is a value available. Without knowing which PIC MCU us are using, it is not possible to provide any further clues as to how this could be done as there are too many variations across the various families.
Susan