[2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequence

We are aware of them, but do not have solutions that don't cause other issues. They go here in order not to take space in the main bug thread list.
zerwiport
Inserter
Inserter
Posts: 35
Joined: Sat Mar 09, 2024 11:03 pm
Contact:

[2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequence

Post by zerwiport »

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.
11-15-2024, 16-36-31.png
11-15-2024, 16-36-31.png (47.11 KiB) Viewed 426 times
Attachments
toolbars-mod_2.7.0.zip
(132.09 KiB) Downloaded 20 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15575
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequenc

Post by Rseding91 »

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.
If you want to get ahold of me I'm almost always on Discord.
zerwiport
Inserter
Inserter
Posts: 35
Joined: Sat Mar 09, 2024 11:03 pm
Contact:

Re: [2.0.15] CustomInput is not triggered when hovering over mod's UI when there is game's control with the same sequenc

Post by zerwiport »

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.
Post Reply

Return to “Minor issues”