Prevent non-valid keys from being entered into the GUI.