Naively I think when you touch it will generate an entity with touch IComponentData into a world you specified. Then any system you have can inject on the touch and read data.
But then there has to be someone that have to destroy “used” touch or the data would remain there across frame.
We could use things like EndFrameBarrier to destroy touches, but then if the input system is able to be frame-independent and these touch entities can appear at any time in a frame, it might be right before the destroy touch system and no one would be able to use it in the next frame.
So I would like to ask what is the ideal interfacing that you would like to work with? It is because I am considering adding this function to my own touch plugin I want to know what user want.
Currently I am towards making the touch entities and never destroy them. It is up to the user to destroy or keep it for other system to use the touch next. Each system can add its own ISystemStateComponentData to indicate “handled by this system” state and subtractive component would prevent it from being injected again. Not sure if I leave all these “handled” touch in the world it would cause performance impact for the next subtractive inject or not?