I decided to post it as a bug because I couldn't find any mention of it in the documentation and I was really surprised that it works this way. It's at least inconsistency.
Steps to reproduce:
1. Create a button (even frame should be enough but a button is my case)
2. Create custom-input
3. Set custom-input sequence to for example Control + Left Click
4. Set Craft 1 to Control + Left Click
5. Use sequence above UI (button, header of a frame, anything) -> it won't be triggered
6. Use sequence not above UI -> it's triggered
If I set not Craft 1 but a different control (I assume it's not UI related in some way) for example open Object's GUI to Control + Left Click then input is triggered even over UI.
Expectation:
custom-input with the same sequence as any other input is triggered even over UI not only when cursor is not over UI
Rationale:
I want to have configurable controls for interactions with my mod's UI. With the current behavior it will be misleading to users and very limiting to force them to use unique sequences in those specific cases.
Similar request: viewtopic.php?t=37658
I attached the mod to quickly reproduce it.
[2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequence
[2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequence
- Attachments
-
- toolbars-mod_2.7.0.zip
- (132.09 KiB) Downloaded 20 times
Re: [2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequenc
Thanks for the report. Looking into this, this is due to the way controls are split between "works anywhere" and "works only in GUI". The "only in GUI" ones will block the "anywhere" ones if the two controls have identical key bindings and the input event happened while the cursor was within a GUI. That system is intended and required for things to function correctly but in this case seems to be producing undesirable results.
I don't currently have an answer for that.
I don't currently have an answer for that.
If you want to get ahold of me I'm almost always on Discord.
Re: [2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequenc
Maybe you could detect that a gui was created by a mod therefore any GUI controls are not working if not implemented by a modder and don't block any of them. Alternative would be to allow a modder to define some inputs as GUI related.