added error checking to the krnKbdDispatchKeyPress function.