CustomInput, conditional consuming property

Place to get help with not working mods / modding interface.
eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

CustomInput, conditional consuming property

Post by eduran »

Is there a way to make a custom input only block game events under certain conditions? Specifically, I would like a hotkey to behave like consuming="game-only" is set when my modded UI is opened. If the UI is closed, it should behave as if consuming="none" is set. I tried to conditionally register for the event, but the key press is still consumed if no event listener is registered.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: CustomInput, conditional consuming property

Post by eradicator »

If you create a custom hotkey, then only your mod would know about it. So i'm not really sure what you're trying to prevent with consuming='game-only'?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
eduran
Filter Inserter
Filter Inserter
Posts: 344
Joined: Fri May 09, 2014 2:52 pm
Contact:

Re: CustomInput, conditional consuming property

Post by eduran »

If I define F5 as a hotkey, that will also open/close the debug overlay. That's what I would like to prevent. Setting consuming to game-only does exactly that, but all the time (i.e. F5 will never do anything that is not specified by my mod).
Post Reply

Return to “Modding help”