inputEventCallbacks
此内容尚不支持你的语言。
inputEventCallbacks(
state):InputEventCallbacks
Defined in: input/input.ts:377
The callbacks a platform’s raw events arrive through — routed past the UI
first, then recorded on state.
Named and exported because the platform binding is not the only caller that
should exist. A harness driving a running game has to be able to deliver a
click, and the only faithful way to do that is through the same funnel the
real event uses: a synthetic DOM event carries no usable offsetX, and
poking mouseX and mouseButtonsPressed by hand skips the router, so UI
that should have swallowed the click never sees it and gameplay behind a
button reacts to presses the player never made.
One implementation, so the injected event and the real one cannot diverge.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”InputEventCallbacks