Implemented a simple keyboard IO thread