Determine right mouse button down?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Determine right mouse button down?

Post 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.
Last edited by NutJob on Tue Nov 11, 2014 7:32 pm, edited 1 time in total.
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Determine right mouse button down?

Post 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
Last edited by Batty on Tue Nov 11, 2014 7:39 pm, edited 2 times in total.
Post Reply