(a) It is narrated from Sayyiduna Amr bin Hurayth (may Allah be pleased with him) that the Prophet (peace and blessings be upon him), while praying, would sometimes also take hold of his beard.
(b) Ibrahim al-Nakha'i (may Allah have mercy on him) said: It used to be said: In the prayer, touch the beard once, or do not touch it even once but leave it.
(c) Imam al-Bayhaqi (may Allah have mercy on him) said: This is similar to what is reported about touching the pebbles once.
It has also been narrated through another, weak, route, and in one of them it is said: without fidgeting.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3431