Author Topic: Using mouse buttons as $KeyPress  (Read 1749 times)

0 Members and 1 Guest are viewing this topic.

Offline Mahak

  • 25
Using mouse buttons as $KeyPress
Does anyone know why I can't substitute a keyboard keypress with (MOUSE_LEFT_BUTTON) in script?  Am I using wrong syntax?

Example:

$KeyPress: t
$On Key Pressed:
[
 Blah blah blah scripty scripty etc. etc.

That works fine.  But if I replace 't' (or any other keyboard key) with MOUSE_LEFT_BUTTON it won't work.

Tried a few different combinations of syntax to no avail.

Anyone have any clues?  I'm guessing I may have to call up some kinda mouse state or something, but I'm a plebe with that kinda thing...

M.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Using mouse buttons as $KeyPress
Did you make sure that the mouse button wasn't already assigned?  I believe that is a default secondary input. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Using mouse buttons as $KeyPress
What's wrong with using io.isMouseButtonDown(MOUSE_LEFT_BUTTON) in an On Frame hook?
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Mahak

  • 25
Re: Using mouse buttons as $KeyPress
Reckon I have to just teach myself a little more scripting.  I'm just trying to mash up stuff with existing scripts, but I think I just have to write my own from the ground up.  Thats ok - it's something I've been putting off for ages, but I need to know how to do it.

I'll read some tutorials & faqs and stuff before I start whining again!

Cheers all.

M.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Using mouse buttons as $KeyPress
One handy tip is to use the "Output scripting to scripting.html" switch in the Launcher's Dev Tool feature list. This will create a file called scripting.html in your FS2 folder, which contains all lua API functions the engine supports.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Mahak

  • 25
Re: Using mouse buttons as $KeyPress
Well thats just made my day.  A cheat sheet!  Awesome.

Once again, hardlight community forums ftw!