Following Adobe's suggestion, I went to the openoffice forum.
Here is an acceptable answer from there:
Intercept Right Click and cause it to run your Python scrpt, which should be treated as any other macro.
Information on the OpenOffice Python/Uno bridge is at http://www.openoffice.org/udk/python/python-bridge.html
some further discussion at http://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=12643
Edit: A similar problem is under discussion here http://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=63716