Handle keyPress instead of synthetic insertNewline to get control over inserted chars. Cancel inserting \n.