Page 1 of 1

Key modifiers in on_gui_click

Posted: Sat Aug 27, 2016 10:17 pm
by apriori
How to find out if gui button was clicked with Shift or Ctrl?

Re: Key modifiers in on_gui_click

Posted: Sat Aug 27, 2016 10:49 pm
by aubergine18
Doesn't seem to be any way to achieve this at present. You could possibly define the button events separately and then see if both events are fired within short space of time (the key first, then the button within 2 seconds or something)?

Re: Key modifiers in on_gui_click

Posted: Sat Aug 27, 2016 10:53 pm
by apriori
Well, does "shift"-hotkey fires each tick while being pressed? If so, then it's possible to handle.

Re: Key modifiers in on_gui_click

Posted: Sat Aug 27, 2016 10:55 pm
by aubergine18
No, I think the hotkeys only fire once when first detected - they don't fire again until the key is released and then pressed again.

Re: Key modifiers in on_gui_click

Posted: Sat Aug 27, 2016 10:59 pm
by apriori
It's bad. I think devs should add event.key_modifier to the on_gui_click event...

Re: Key modifiers in on_gui_click

Posted: Sat Aug 27, 2016 11:02 pm
by aubergine18
Yes, it would be very welcome. Head over to the modding interface requests forum and put in a request?