fixed a bug related to checking hwKeyboardPresent when showing virtual keyboard