Key modifiers in on_gui_click
Key modifiers in on_gui_click
How to find out if gui button was clicked with Shift or Ctrl?
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Key modifiers in on_gui_click
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)?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Key modifiers in on_gui_click
Well, does "shift"-hotkey fires each tick while being pressed? If so, then it's possible to handle.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Key modifiers in on_gui_click
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.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Key modifiers in on_gui_click
It's bad. I think devs should add event.key_modifier to the on_gui_click event...
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Key modifiers in on_gui_click
Yes, it would be very welcome. Head over to the modding interface requests forum and put in a request?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.