Fixes #16620.  Check for readOnly before checking for keyPressed.