pdfSetMouseDownCbk
Set a callback function for mouse button-down events.
void pdfSetMouseDownCbk(PDFViewerHandle viewer,
void (*cbk)(void *data, int button, int shift,
int page, double x, double y),
void *data)
This function sets a callback which will be called when the user
presses a mouse button.
The function will be called with six arguments:
data
: the value of thedata
argument that was passed topdfSetMouseDownCbk
button
: the mouse button number - one ofpdfLeftButton
,pdfMiddleButton
, orpdfRightButton
shift
: the shift/control/alt bit mask, which contains zero or more bit flags frompdfShiftKey
,pdfCtrlKey
, andpdfAltKey
page
: the page number where the mouse button was clickedx, y
: the position where the mouse button was clicked, in PDF coordinates
C:
void mouseDownCbk(void *data, int button, int shift,
int page, double x, double y) {
Context *myContext = (Context *)data;
/* a mouse button was pressed ... */
}
....
pdfSetMouseDownCbk(viewer, &mouseDownCbk, &myContext);