Moved acceptableCharsRegex test to the keypress event handler

to capture shiftKey altered charCodes.