'Right-click' with a tablet stylus is a pain in the artist.
If your stylus is touching the tablet when you press the right-click, it's recorded as a left-click.
So what you need to do is hover the stylus very slightly above the surface of the tablet and press the right-click button. But doing that often moves your stylus slightly, which is recorded as a right-click + drag.
A technique I find useful for right-clicking with a stylus is to extend my middle finger down past the tip of the stylus, touch my finger to the tablet (which holds the stylus in place pressed against my finger, hovering just above the tablet), and click the rocker switch with my index finger.
It sounds awkward but once you get used to it it's very easy to do a precise right-click for menus.
AndyRage's mantra for graphics engine code:
"Sure - how hard can it be?"