Modified typeText and hideSoftKeyboard