Function isKeyboardAction