What? I've always done..
NPC Code:
//#CLIENTSIDE
function onMouseDown()
{
if ( params[0] == "left" ) {
player.chat = "You have just left clicked!";
} else if ( params[0] == "right" ) {
player.chat = "You have just right clicked!";
} else if ( params[0] == "double" ) {
player.chat = "You have just double clicked!";
} else if ( params[0] == "middle" ) {
player.chat = "You have just clicked on your mouse wheel!";
}
}
..and it's always worked fine for me.