Added blocking keyboard callback function