Revise code to handle IME hide key