Fixing deprectation warnings for posting keyboard events and open dialogs