Keyboard forbidden characters refactored