Frame based mouse is down

Hey can some one tell me how to run a code every frame that the mouse button is held down. Also Ineed it to be frame based. thanks.