that a man peeked in on the Messenger of Allah ﷺ, in one of the apartments of the Prophet ﷺ, while the Prophet ﷺ had a Midrah (an iron comb) with which he was scratching his head. So the Prophet ﷺ said: "If I knew that you were looking then I would have poked your eyes with it. Seeking permission has only been enjoined because of the sight."
أَنَّ رَجُلاً اطَّلَعَ عَلَى رَسُولِ اللَّهِ ﷺ مِنْ جُحْرٍ فِي حُجْرَةِ النَّبِيِّ ﷺ وَمَعَ النَّبِيِّ ﷺ مِدْرَاةٌ يَحُكُّ بِهَا رَأْسَهُ فَقَالَ النَّبِيُّ ﷺ لَوْ عَلِمْتُ أَنَّكَ تَنْظُرُ لَطَعَنْتُ بِهَا فِي عَيْنِكَ إِنَّمَا جُعِلَ الاِسْتِئْذَانُ مِنْ أَجْلِ الْبَصَرِ وَفِي الْبَابِ عَنْ أَبِي هُرَيْرَةَ