Keys got special meaning and shouldn’t be fed into parts of the GUI? This handy little snippet takes care of that job:
private string text = "I bet you can't type an A!"; static void DisableKeys( KeyCode[] keys ) { if( !Event.current.isKey ) { return; } foreach( KeyCode key in keys ) { if( Event.current.keyCode == key ) { Event.current.Use(); } } } static void DisableKey( KeyCode key ) { DisableKeys( new KeyCode[]{ key } ); } void OnGUI() { DisableKey( KeyCode.A ); text = GUILayout.TextArea( text ); }