Search for this in the gamestudio manual: EVENT_RIGHTCLICK. And in the function that does the effects of clicking use:

if (event_type == EVENT_RIGHTCLICK) {...}