-
Notifications
You must be signed in to change notification settings - Fork 13
Input types and functions
This category contains the types and functions for querying keyboard, mouse and gamepad information. More...
| Type | Name |
|---|---|
| struct |
fplGamepadButton A structure containing properties for a gamepad button (IsDown, etc.). More... |
| struct |
fplGamepadData Backend-agnostic snapshot of raw device input that a fplGamepadMapping operates on. More... |
| struct |
fplGamepadEvent A structure containing gamepad event data (Type, Device, State, etc.). More... |
| struct |
fplGamepadInfo Read-only description of a controller passed to a fpl_gamepad_mapping_resolver_callback at connect time. More... |
| struct |
fplGamepadInputBinding Describes the raw input source bound to one logical FPL gamepad button or axis slot. More... |
| struct |
fplGamepadMapping A complete mapping of raw device inputs onto FPL's logical gamepad layout. More... |
| struct |
fplGamepadState A structure containing the entire gamepad state, that defines a full gamepad state in XInput/XBox layout. More... |
| struct |
fplGamepadStates A struct containing the full state for all gamepad devices. More... |
| struct |
fplInputBackendSupport Describes the capabilities of a single input backend. More... |
| struct |
fplInputDevice Describes a single input device exposed by some backend. More... |
| struct |
fplInputDeviceGuid A 128-bit identifier uniquely identifying an input device across backends. More... |
| struct |
fplKeyboardState A struct containing the full keyboard state. More... |
| struct |
fplMouseState A struct containing the full mouse state. More... |
| Type | Name |
|---|---|
| #define |
FPL_GAMEPAD_BUTTON_COUNT Number of logical button slots stored in a fplGamepadMapping (matches fplGamepadButtonType). |
| #define |
FPL_GAMEPAD_DATA_MAX_AXES Maximum number of raw axes captured in a fplGamepadData snapshot. |
| #define |
FPL_GAMEPAD_DATA_MAX_BUTTONS Maximum number of raw buttons captured in a fplGamepadData snapshot. |
| #define |
FPL_GAMEPAD_DATA_MAX_HATS Maximum number of raw hats captured in a fplGamepadData snapshot. |
| #define |
FPL_GAMEPAD_GUID_SIZE Defines the size of a game controller GUID in bytes. |
| #define |
FPL_MAX_GAMEPAD_STATE_COUNT Max number of gamepad states. |
| #define |
FPL_MAX_INPUT_DEVICE_COUNT Maximum number of devices held by the input subsystem at once. |
| #define |
FPL_MAX_INPUT_DEVICE_NAME Maximum length of the fplInputDevice name field. |
| #define |
FPL_MAX_KEYBOARD_STATE_COUNT fplKeyboardModifierFlags operator overloads for C++. |
| Type | Name |
|---|---|
| typedef uint8_t |
fplGamepadGuid[FPL_GAMEPAD_GUID_SIZE] A typedef that defines a 16-byte GUID used to identify a game controller. |
| typedef char |
fplGamepadName[FPL_MAX_NAME_LENGTH] A typedef that defines the name of a game controller. |
| Type | Name |
|---|---|
| fpl_common_api bool |
fplFindInputDevice (const fplInputDeviceGuid *guid, fplInputDevice *outDevice) Looks up a single device by its GUID. |
| fpl_common_api bool |
fplGamepadMappingApply (const fplGamepadMapping *mapping, const fplGamepadData *input, fplGamepadState *outState) Applies a fplGamepadMapping over a raw device snapshot and writes the result into outState. |
| fpl_common_api bool |
fplGamepadMappingApplyDefault (const fplGamepadData *input, fplGamepadState *outState) Applies the built-in default convention to a raw device snapshot when no mapping is installed. |
| fpl_common_api uint32_t |
fplGetGamepadDevices (fplInputDevice *outDevices, const uint32_t maxDevices) Convenience wrapper that returns devices with fplInputSourceType_Gamepad. |
| fpl_common_api uint32_t |
fplGetInputBackendSupport (fplInputBackendSupport *outSupports, const uint32_t maxCount) Writes capabilities of all known input backends into outSupports. |
| fpl_common_api bool |
fplGetInputBackendSupportByType (const fplInputBackendType type, fplInputBackendSupport *outSupport) Looks up the support descriptor for a single backend type. |
| fpl_common_api uint32_t |
fplGetInputDevices (const fplInputSourceType sourceFilter, fplInputDevice *outDevices, const uint32_t maxDevices) Enumerates all input devices currently known to the input subsystem. |
| fpl_common_api uint32_t |
fplGetKeyboardDevices (fplInputDevice *outDevices, const uint32_t maxDevices) Convenience wrapper that returns devices with fplInputSourceType_Keyboard. |
| fpl_common_api uint32_t |
fplGetMouseDevices (fplInputDevice *outDevices, const uint32_t maxDevices) Convenience wrapper that returns devices with fplInputSourceType_Mouse. |
| fpl_common_api const char * |
fplKeyGetName (const fplKey key) Gets the string representation of the given key. |
| fpl_platform_api bool |
fplPollGamepadStates (fplGamepadStates *outStates) Polls the current gamepad states and writes it out into the output structure. |
| fpl_platform_api bool |
fplPollKeyboardState (fplKeyboardState *outState) Polls the current keyboard state and writes it out into the output structure. |
| fpl_platform_api bool |
fplPollMouseState (fplMouseState *outState) Polls the current mouse state and writes it out into the output structure. |
| fpl_common_api bool |
fplUpdateInputDevices (void) Refreshes the input subsystem's device list and processes pending hotplug events. |
This category contains the types and functions for querying keyboard, mouse and gamepad information.
#define FPL_GAMEPAD_BUTTON_COUNTNumber of logical button slots stored in a fplGamepadMapping (matches fplGamepadButtonType).
Definition at line 9448 of file final_platform_layer.h.
#define FPL_GAMEPAD_DATA_MAX_AXESMaximum number of raw axes captured in a fplGamepadData snapshot.
Definition at line 9466 of file final_platform_layer.h.
#define FPL_GAMEPAD_DATA_MAX_BUTTONSMaximum number of raw buttons captured in a fplGamepadData snapshot.
Definition at line 9468 of file final_platform_layer.h.
#define FPL_GAMEPAD_DATA_MAX_HATSMaximum number of raw hats captured in a fplGamepadData snapshot.
Definition at line 9470 of file final_platform_layer.h.
#define FPL_GAMEPAD_GUID_SIZEDefines the size of a game controller GUID in bytes.
Definition at line 9171 of file final_platform_layer.h.
#define FPL_MAX_GAMEPAD_STATE_COUNTMax number of gamepad states.
Definition at line 9344 of file final_platform_layer.h.
#define FPL_MAX_INPUT_DEVICE_COUNTMaximum number of devices held by the input subsystem at once.
Definition at line 9540 of file final_platform_layer.h.
#define FPL_MAX_INPUT_DEVICE_NAMEMaximum length of the fplInputDevice name field.
Definition at line 9537 of file final_platform_layer.h.
#define FPL_MAX_KEYBOARD_STATE_COUNTfplKeyboardModifierFlags operator overloads for C++.
Max number of keyboard states.
Definition at line 9094 of file final_platform_layer.h.
typedef uint8_t fplGamepadGuid[FPL_GAMEPAD_GUID_SIZE]A typedef that defines a 16-byte GUID used to identify a game controller.
Definition at line 9177 of file final_platform_layer.h.
typedef char fplGamepadName[FPL_MAX_NAME_LENGTH]A typedef that defines the name of a game controller.
Definition at line 9165 of file final_platform_layer.h.
enum fplButtonStateAn enumeration of button states.
| Name | Description |
|---|---|
| fplButtonState_Release | Key released. |
| fplButtonState_Press | Key pressed. |
| fplButtonState_Repeat | Key is held down. |
Definition at line 8711 of file final_platform_layer.h.
enum fplGamepadAxisSignHalf-axis selector used when an axis source is bound with the SDL +/- prefixes.
Definition at line 9381 of file final_platform_layer.h.
enum fplGamepadAxisTypeLogical analog axis slots filled by a fplGamepadMapping.
Definition at line 9411 of file final_platform_layer.h.
enum fplGamepadButtonTypeAn enumeration of gamepad buttons.
Definition at line 9192 of file final_platform_layer.h.
enum fplGamepadEventTypeAn enumeration of gamepad event types (Connected, Disconnected, StateChanged, etc.).
Definition at line 9314 of file final_platform_layer.h.
enum fplGamepadInputTypeSource kind referenced by a single fplGamepadInputBinding.
| Name | Description |
|---|---|
| fplGamepadInputType_None | Slot is unbound. |
| fplGamepadInputType_Button | Digital button at fplGamepadInputBinding::index. |
| fplGamepadInputType_Axis | Analog axis at fplGamepadInputBinding::index. |
| fplGamepadInputType_Hat | Hat (POV) at fplGamepadInputBinding::index, sampled with fplGamepadInputBinding::hatMask. |
Definition at line 9366 of file final_platform_layer.h.
enum fplGamepadPlatformTarget platform tag of a fplGamepadMapping (mirrors the SDL platform: field).
Definition at line 9432 of file final_platform_layer.h.
enum fplInputConnectionStateInputDeviceFeatureFlags operator overloads for C++.
Connection state of an input device.
Definition at line 9572 of file final_platform_layer.h.
enum fplInputDeviceFeatureFlagsBitmask describing the features a single fplInputDevice supports.
Definition at line 9555 of file final_platform_layer.h.
enum fplKeyAn enumeration of mapped keys (Based on MS Virtual-Key-Codes, mostly directly mapped from ASCII).
Definition at line 8724 of file final_platform_layer.h.
enum fplKeyboardModifierFlagsAn enumeration of keyboard modifier flags.
Definition at line 9061 of file final_platform_layer.h.
enum fplMouseButtonTypeAn enumeration of mouse button types (Left, Right, etc.).
Definition at line 9120 of file final_platform_layer.h.
fpl_common_api bool fplFindInputDevice ( const fplInputDeviceGuid * guid, fplInputDevice * outDevice )Looks up a single device by its GUID.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | guid | Reference to the GUID to find. |
| [out] | outDevice | Reference to the destination structure. |
Returns: True when the device was found, false otherwise.
fpl_common_api bool fplGamepadMappingApply ( const fplGamepadMapping * mapping, const fplGamepadData * input, fplGamepadState * outState )Applies a fplGamepadMapping over a raw device snapshot and writes the result into outState.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | mapping | Mapping to evaluate. |
| [in] | input | Raw device snapshot collected by the backend. |
| [out] | outState | Logical gamepad state populated from the mapping. |
Returns: false when any pointer is null, true on success. Buttons and analog axes are written; deviceName/isConnected/isActive are left untouched.
fpl_common_api bool fplGamepadMappingApplyDefault ( const fplGamepadData * input, fplGamepadState * outState )Applies the built-in default convention to a raw device snapshot when no mapping is installed.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | input | Raw device snapshot collected by the backend. |
| [out] | outState | Logical gamepad state populated from the default convention. |
Returns: false when any pointer is null, true on success.
Note: The default convention follows SDL's "unknown DInput device" layout — buttons 0..3 → A/B/X/Y, 4/5 → shoulders, 8/9 → back/start, 10/11 → thumb buttons; axes 0/1 → left stick, 2/5 → right stick (XYZ-RZ DInput quirk), 6/7 → triggers; hat[0] → dpad. Backends that produce a different raw layout (e.g. Linux joydev) should still align with this ordering for the default to be useful.
fpl_common_api uint32_t fplGetInputBackendSupport ( fplInputBackendSupport * outSupports, const uint32_t maxCount )Writes capabilities of all known input backends into outSupports.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | outSupports | Caller-supplied array, may be null when maxCount is 0. |
| [in] | maxCount | Capacity of outSupports. |
Returns: Number of backend descriptors written, or the total count when
outSupportsis null.
fpl_common_api bool fplGetInputBackendSupportByType ( const fplInputBackendType type, fplInputBackendSupport * outSupport )Looks up the support descriptor for a single backend type.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | type | The backend type to query. |
| [out] | outSupport | Reference to the destination structure. |
Returns: True when the backend is known to the build, false otherwise.
fpl_common_api uint32_t fplGetInputDevices ( const fplInputSourceType sourceFilter, fplInputDevice * outDevices, const uint32_t maxDevices )Enumerates all input devices currently known to the input subsystem.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | sourceFilter | Bitmask of fplInputSourceType to filter by, or fplInputSourceType_All. |
| [out] | outDevices | Caller-supplied array, may be null when maxDevices is 0. |
| [in] | maxDevices | Capacity of outDevices. |
Returns: Number of devices written.
fpl_common_api const char * fplKeyGetName ( const fplKey key)Gets the string representation of the given key.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | key | The enumeration value fplKey. |
Returns: Returns a string for the given key.
fpl_platform_api bool fplPollGamepadStates ( fplGamepadStates * outStates)Polls the current gamepad states and writes it out into the output structure.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | outStates | Reference to the gamepad states structure fplGamepadStates. |
See also: Gamepad
fpl_platform_api bool fplPollKeyboardState ( fplKeyboardState * outState)Polls the current keyboard state and writes it out into the output structure.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | outState | Reference to the keyboard state structure fplKeyboardState. |
See also: Keyboard
fpl_platform_api bool fplPollMouseState ( fplMouseState * outState)Polls the current mouse state and writes it out into the output structure.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | outState | Reference to the mouse state structure fplMouseState. |
See also: Mouse
fpl_common_api bool fplUpdateInputDevices ( void )Refreshes the input subsystem's device list and processes pending hotplug events.
Returns: True when at least one backend reported a change.
- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities