Strip dead code and fix a typo in preferences
Post event directly to input text field instead of window to avoid an infinite loop