This is working fine for me when pressing the left mouse button.
void ofApp::mousePressed(int x, int y, int button){
if (button == 0) {
clicked = !clicked;
cout << clicked << endl;
}
}
Maybe something else is going wrong? Could you post more code concerning your issue?