How to make the dashboard-button in dashboard receive press&hold input

Something like this: How to make a button that send msg once on click and sends msg repeated at set interval on button hold? - #4 by Steve-Mcl ?