Page 1 of 1

Report used keys in on_gui_click event.

Posted: Thu Mar 16, 2017 8:08 am
by eradicator
It would be much easier to make vanilla-like GUIs if the buttons used to do the clicking in on_gui_click events were available, as currently all buttons and modifiers are the same.

This could be a simple "control"-like string

Code: Select all

event.control = "Shift + Right mouse button"
or preferably a table for easier processing:

Code: Select all

event.buttons = {
  left = false,
  right = true,
  ctrl = false,
  shift = true,
  alt = false,
}
Because the event still fires for all clicks old mods would still work as before ensuring a smooth transition.

Re: Report used keys in on_gui_click event.

Posted: Thu Mar 16, 2017 7:10 pm
by Rseding91
The mouse button info is known only for the "gui_clicked" event. The other events like gui check state changed don't have an associated mouse anything.

I'll add the mouse button for the clicked event for 0.15.

Re: Report used keys in on_gui_click event.

Posted: Tue Mar 21, 2017 12:39 am
by eradicator
Great! Thanks :D. (I think i can live without modifyer keys on check boxes.)