add keyboard processing and fix background