ProtectedcurrentProtectedcurrentProtectedcurrentProtectedlastProtectedlastMake sure this is set after the other member variables.
This is not-null asserted because updateInputDevices, which sets it, is called in the constructor.
ProtectedloopProtectedattachAttaches global event listeners for keyboard and mouse input.
ProtectedfireConstructs and dispatches events for changes between device reads.
ProtectedgetReads all inputs devices and their current inputs according to the given deadZone settings and returns current input values.
Does not update any internal state or fire any event listeners that have been attached to the input handler. Thus, this is not public.
This does not trigger a new poll of devices. Thus, the value retrieved here might be out of date. For example, if you previously paused polling, the returned value here would be from right before polling was paused.
Stop the internal loop for polling input devices.
Updates the internal state of all current devices and triggers all relevant listeners.
Use this if method if you're hooking up polling to your own system. For example, if you already have a render loop, call this method to update all inputs and read their values.
If you just want to read the last values but already have InputDeviceHandler running its loop, instead call getLastPollResults.
DeadZone for all inputs.
ProtectedremoveRemoves all global event listeners attached by this handler.
ProtectedrunReads device values continuously while the polling loop is active.
Start an internal loop which polls all devices on each animation frame.
The main export of this package. Construct one to start listening to and handling input devices.