Prevent invalid input

Added a list of invalid character codes (some reliant on shift being
held while being used) to prevent invalid input.