No, that's horrible way to do it.
It's much simpler then that too. Just do this:
PHP Code:
function obj.onSelect() {
// Left Click stuff
}
function obj.onOpenMenu() {
// Right Click stuff
}
If onSelect is still being called when you right click, just replace that function with:
PHP Code:
function obj.onSelect() {
if (!leftmousebuttonglobal) return;
// Left Click stuff
}
Most of that info can be found
here.
