void mouseWasClicked(MouseEvent event) { if (event.isLeft()) { cout << "Left mouse button was clicked" << endl; } }
void mouseWasClicked(MouseEvent event) { int x = event.getX(); int y = event.getY(); cout << "Mouse was clicked at (" << x << "," << y << ")" << endl; }This example gets the coordinates of where the mouse was clicked and displays them. Package Library: This MouseEvent is a part of the Cinder package library, which is a C++ library for creative coding.