Restore changes to keyboard to be threaded or unthreaded.