Page 1 of 1

Determine right mouse button down?

Posted: Tue Nov 11, 2014 7:02 pm
by NutJob
I have:

Code: Select all

         onDrawGui = function(self, context)
            print(self.go.id, context.mouseDown(2))
         end,
No clue how to determine if the right mouse button is down, always returns false.

More testing: just tried keyDown(38) expecting it to use a keyCode but it requires a string (extremely odd that it wouldn't) so looked in cfg file and it's "move_forward" so tried that. Didn't work. Making great progress now, eh? ~laughs~



---


Just for fun: moving to a new coordinate progresses time by 0.0007 and turning (in place) progresses time by 0.00035 (so a 180 turn (2) is the same as moving one square). I'm sure that was an exciting FYI.

Re: Determine right mouse button down?

Posted: Tue Nov 11, 2014 7:31 pm
by Batty
Try this:

Code: Select all

onDrawGui = function(self, context)
   print(self.go.id .. tostring(context.mouseDown(2)))
end
or:

Code: Select all

onDrawGui = function(self, context)
   if context.mouseDown(2) then print("right button down") end
end