Disallow non-printable ascii or non-ascii characters in input

xdotool doesn't like it otherwise (https://code.google.com/p/semicomplete/issues/detail?id=14).