Blockland Forums > Modification Help
Left Mouse Button for GUI ".accelerator"
Bauklotz:
So, I have this GUI where I click at any time somewhere on the GUI while it is open, and a action happens.
I've tried setting .accelerator for a control to 'mouse0' and other stuff, but nuthin' works.
What is the correct 'key name' for LMB?
Ephialtes:
The accelerator option only applies to the keyboard.
You should be using a GuiMouseEventCtrl.
Bauklotz:
So, GuiMouseEventCtrl object here.accelerator = mouse0;?
EDIT: That didn't work.
Ephialtes:
No - GuiMouseEventCtrl has callbacks for mouse events. Look up some documentation for it.
Bauklotz:
I tried looking at a documentation and used
--- Code: ---function some_object_name_here::onMouseDown(%this,%mod,%pos,%click)
{
// DOSTUFF
}
--- End code ---
But "// DOSTUFF" wasn't executed when I pressed down left mouse button.