button long press detect

If I want detect the buttons long press for mouse key hold, how to do?