|
Final Platform Layer 1.0.0
|
FPL supports manual polling of input states for Keyboard/Gamepad/Mouse as well.
If you only use polling to get your input states, you should disable the input-events entirely.
This is done by simply setting the fplInputSettings::disabledEvents to "1" in your fplSettings structure.
Use fplPollKeyboardState to poll the current keyboard state.
This state contains all the raw/mapped button states and the modifier states.
See fplKeyboardState for more details.
Use fplPollGamepadStates to poll the current states for all connected game controllers.
This state contains all the buttons, digital-pad, the left/right stick position + trigger, etc.
See fplGamepadStates for more details.
Use fplPollMouseState to poll the current mouse state.
This state contains the state of all the buttons (Left, Right, Middle) and the position in pixels coordinates.
See fplMouseState for more details.
When the application runs without a window (FPL_NO_WINDOW or fplInputSettings::detachFromWindow), the input subsystem is not driven by a window event loop. Call fplUpdateInputDevices once per frame to refresh cached state and dispatch gamepad connect/disconnect events. fplPollEvent and fplPollEvents also work in this mode and drive the input subsystem internally.
See Using input without a window for a full example.