Skip to content

Input types and functions

Finalspace edited this page May 29, 2026 · 1 revision

This category contains the types and functions for querying keyboard, mouse and gamepad information. More...

Data Structures

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...

Macros

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++.

Typedefs

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.

Enumerations

Type Name
enum fplButtonState { fplButtonState_Release , fplButtonState_Press , fplButtonState_Repeat }
An enumeration of button states. More...
enum fplGamepadAxisSign { fplGamepadAxisSign_Full , fplGamepadAxisSign_Positive , fplGamepadAxisSign_Negative }
Half-axis selector used when an axis source is bound with the SDL +/- prefixes. More...
enum fplGamepadAxisType {
fplGamepadAxisType_LeftX , fplGamepadAxisType_LeftY , fplGamepadAxisType_RightX , fplGamepadAxisType_RightY ,
fplGamepadAxisType_LeftTrigger , fplGamepadAxisType_RightTrigger , fplGamepadAxisType_Count
}
Logical analog axis slots filled by a fplGamepadMapping. More...
enum fplGamepadButtonType {
fplGamepadButtonType_DPadUp , fplGamepadButtonType_DPadRight , fplGamepadButtonType_DPadDown , fplGamepadButtonType_DPadLeft ,
fplGamepadButtonType_ActionA , fplGamepadButtonType_ActionB , fplGamepadButtonType_ActionX , fplGamepadButtonType_ActionY ,
fplGamepadButtonType_Start , fplGamepadButtonType_Back , fplGamepadButtonType_LeftThumb , fplGamepadButtonType_RightThumb ,
fplGamepadButtonType_LeftShoulder , fplGamepadButtonType_RightShoulder
}
An enumeration of gamepad buttons. More...
enum fplGamepadEventType { fplGamepadEventType_None , fplGamepadEventType_Connected , fplGamepadEventType_Disconnected , fplGamepadEventType_StateChanged }
An enumeration of gamepad event types (Connected, Disconnected, StateChanged, etc.). More...
enum fplGamepadInputType { fplGamepadInputType_None , fplGamepadInputType_Button , fplGamepadInputType_Axis , fplGamepadInputType_Hat }
Source kind referenced by a single fplGamepadInputBinding. More...
enum fplGamepadPlatform {
fplGamepadPlatform_Unknown , fplGamepadPlatform_Windows , fplGamepadPlatform_Linux , fplGamepadPlatform_MacOS ,
fplGamepadPlatform_Android , fplGamepadPlatform_iOS
}
Target platform tag of a fplGamepadMapping (mirrors the SDL platform: field). More...
enum fplInputConnectionState { fplInputConnectionState_Unknown , fplInputConnectionState_Disconnected , fplInputConnectionState_Connected }
InputDeviceFeatureFlags operator overloads for C++. More...
enum fplInputDeviceFeatureFlags { fplInputDeviceFeatureFlags_None , fplInputDeviceFeatureFlags_Polling , fplInputDeviceFeatureFlags_Events , fplInputDeviceFeatureFlags_Hotplug }
Bitmask describing the features a single fplInputDevice supports. More...
enum fplKey {
fplKey_None , fplKey_Backspace , fplKey_Tab , fplKey_Clear ,
fplKey_Return , fplKey_Shift , fplKey_Control , fplKey_Alt ,
fplKey_Pause , fplKey_CapsLock , fplKey_Escape , fplKey_Space ,
fplKey_PageUp , fplKey_PageDown , fplKey_End , fplKey_Home ,
fplKey_Left , fplKey_Up , fplKey_Right , fplKey_Down ,
fplKey_Select , fplKey_Print , fplKey_Execute , fplKey_Snapshot ,
fplKey_Insert , fplKey_Delete , fplKey_Help , fplKey_0 ,
fplKey_1 , fplKey_2 , fplKey_3 , fplKey_4 ,
fplKey_5 , fplKey_6 , fplKey_7 , fplKey_8 ,
fplKey_9 , fplKey_A , fplKey_B , fplKey_C ,
fplKey_D , fplKey_E , fplKey_F , fplKey_G ,
fplKey_H , fplKey_I , fplKey_J , fplKey_K ,
fplKey_L , fplKey_M , fplKey_N , fplKey_O ,
fplKey_P , fplKey_Q , fplKey_R , fplKey_S ,
fplKey_T , fplKey_U , fplKey_V , fplKey_W ,
fplKey_X , fplKey_Y , fplKey_Z , fplKey_LeftSuper ,
fplKey_RightSuper , fplKey_Apps , fplKey_Sleep , fplKey_NumPad0 ,
fplKey_NumPad1 , fplKey_NumPad2 , fplKey_NumPad3 , fplKey_NumPad4 ,
fplKey_NumPad5 , fplKey_NumPad6 , fplKey_NumPad7 , fplKey_NumPad8 ,
fplKey_NumPad9 , fplKey_Multiply , fplKey_Add , fplKey_Separator ,
fplKey_Substract , fplKey_Decimal , fplKey_Divide , fplKey_F1 ,
fplKey_F2 , fplKey_F3 , fplKey_F4 , fplKey_F5 ,
fplKey_F6 , fplKey_F7 , fplKey_F8 , fplKey_F9 ,
fplKey_F10 , fplKey_F11 , fplKey_F12 , fplKey_F13 ,
fplKey_F14 , fplKey_F15 , fplKey_F16 , fplKey_F17 ,
fplKey_F18 , fplKey_F19 , fplKey_F20 , fplKey_F21 ,
fplKey_F22 , fplKey_F23 , fplKey_F24 , fplKey_NumLock ,
fplKey_Scroll , fplKey_LeftShift , fplKey_RightShift , fplKey_LeftControl ,
fplKey_RightControl , fplKey_LeftAlt , fplKey_RightAlt , fplKey_VolumeMute ,
fplKey_VolumeDown , fplKey_VolumeUp , fplKey_MediaNextTrack , fplKey_MediaPrevTrack ,
fplKey_MediaStop , fplKey_MediaPlayPause , fplKey_Oem1 , fplKey_OemPlus ,
fplKey_OemComma , fplKey_OemMinus , fplKey_OemPeriod , fplKey_Oem2 ,
fplKey_Oem3 , fplKey_Oem4 , fplKey_Oem5 , fplKey_Oem6 ,
fplKey_Oem7 , fplKey_Oem8 , fplKey_Last , fplKey_First
}
An enumeration of mapped keys (Based on MS Virtual-Key-Codes, mostly directly mapped from ASCII). More...
enum fplKeyboardModifierFlags {
fplKeyboardModifierFlags_None , fplKeyboardModifierFlags_LAlt , fplKeyboardModifierFlags_RAlt , fplKeyboardModifierFlags_LCtrl ,
fplKeyboardModifierFlags_RCtrl , fplKeyboardModifierFlags_LShift , fplKeyboardModifierFlags_RShift , fplKeyboardModifierFlags_LSuper ,
fplKeyboardModifierFlags_RSuper , fplKeyboardModifierFlags_CapsLock , fplKeyboardModifierFlags_NumLock , fplKeyboardModifierFlags_ScrollLock
}
An enumeration of keyboard modifier flags. More...
enum fplMouseButtonType {
fplMouseButtonType_None , fplMouseButtonType_Left , fplMouseButtonType_Right , fplMouseButtonType_Middle ,
fplMouseButtonType_X1 , fplMouseButtonType_X2 , fplMouseButtonType_MaxCount
}
An enumeration of mouse button types (Left, Right, etc.). More...

Functions

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.

Detailed Description

This category contains the types and functions for querying keyboard, mouse and gamepad information.

Macro Definition Documentation

FPL_GAMEPAD_BUTTON_COUNT

#define FPL_GAMEPAD_BUTTON_COUNT

Number of logical button slots stored in a fplGamepadMapping (matches fplGamepadButtonType).

Definition at line 9448 of file final_platform_layer.h.

FPL_GAMEPAD_DATA_MAX_AXES

#define FPL_GAMEPAD_DATA_MAX_AXES

Maximum number of raw axes captured in a fplGamepadData snapshot.

Definition at line 9466 of file final_platform_layer.h.

FPL_GAMEPAD_DATA_MAX_BUTTONS

#define FPL_GAMEPAD_DATA_MAX_BUTTONS

Maximum number of raw buttons captured in a fplGamepadData snapshot.

Definition at line 9468 of file final_platform_layer.h.

FPL_GAMEPAD_DATA_MAX_HATS

#define FPL_GAMEPAD_DATA_MAX_HATS

Maximum number of raw hats captured in a fplGamepadData snapshot.

Definition at line 9470 of file final_platform_layer.h.

FPL_GAMEPAD_GUID_SIZE

#define FPL_GAMEPAD_GUID_SIZE

Defines the size of a game controller GUID in bytes.

Definition at line 9171 of file final_platform_layer.h.

FPL_MAX_GAMEPAD_STATE_COUNT

#define FPL_MAX_GAMEPAD_STATE_COUNT

Max number of gamepad states.

Definition at line 9344 of file final_platform_layer.h.

FPL_MAX_INPUT_DEVICE_COUNT

#define FPL_MAX_INPUT_DEVICE_COUNT

Maximum number of devices held by the input subsystem at once.

Definition at line 9540 of file final_platform_layer.h.

FPL_MAX_INPUT_DEVICE_NAME

#define FPL_MAX_INPUT_DEVICE_NAME

Maximum length of the fplInputDevice name field.

Definition at line 9537 of file final_platform_layer.h.

FPL_MAX_KEYBOARD_STATE_COUNT

#define FPL_MAX_KEYBOARD_STATE_COUNT

fplKeyboardModifierFlags operator overloads for C++.

Max number of keyboard states.

Definition at line 9094 of file final_platform_layer.h.

Typedef Documentation

fplGamepadGuid

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.

fplGamepadName

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.

Enumeration Type Documentation

fplButtonState

enum fplButtonState

An 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.

fplGamepadAxisSign

enum fplGamepadAxisSign

Half-axis selector used when an axis source is bound with the SDL +/- prefixes.

Name Description
fplGamepadAxisSign_Full Use the full axis range (-1 .. +1).
fplGamepadAxisSign_Positive Only the positive half (+aN form). Output is remapped to 0 .. 1.
fplGamepadAxisSign_Negative Only the negative half (-aN form). Output is remapped to 0 .. 1.

Definition at line 9381 of file final_platform_layer.h.

fplGamepadAxisType

enum fplGamepadAxisType

Logical analog axis slots filled by a fplGamepadMapping.

Name Description
fplGamepadAxisType_LeftX Left thumb stick X.
fplGamepadAxisType_LeftY Left thumb stick Y.
fplGamepadAxisType_RightX Right thumb stick X.
fplGamepadAxisType_RightY Right thumb stick Y.
fplGamepadAxisType_LeftTrigger Left trigger (0 .. 1).
fplGamepadAxisType_RightTrigger Right trigger (0 .. 1).
fplGamepadAxisType_Count Number of logical axis slots.

Definition at line 9411 of file final_platform_layer.h.

fplGamepadButtonType

enum fplGamepadButtonType

An enumeration of gamepad buttons.

Name Description
fplGamepadButtonType_DPadUp DPad up.
fplGamepadButtonType_DPadRight DPad right.
fplGamepadButtonType_DPadDown DPad down.
fplGamepadButtonType_DPadLeft DPad left.
fplGamepadButtonType_ActionA Action-A.
fplGamepadButtonType_ActionB Action-B.
fplGamepadButtonType_ActionX Action-X.
fplGamepadButtonType_ActionY Action-Y.
fplGamepadButtonType_Start Start.
fplGamepadButtonType_Back Back.
fplGamepadButtonType_LeftThumb Left-Thumb.
fplGamepadButtonType_RightThumb Right-Thumb.
fplGamepadButtonType_LeftShoulder Left-Shoulder.
fplGamepadButtonType_RightShoulder Right-Shoulder.

Definition at line 9192 of file final_platform_layer.h.

fplGamepadEventType

enum fplGamepadEventType

An enumeration of gamepad event types (Connected, Disconnected, StateChanged, etc.).

Name Description
fplGamepadEventType_None No gamepad event.
fplGamepadEventType_Connected Gamepad connected.
fplGamepadEventType_Disconnected Gamepad disconnected.
fplGamepadEventType_StateChanged Gamepad state updated.

Definition at line 9314 of file final_platform_layer.h.

fplGamepadInputType

enum fplGamepadInputType

Source 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.

fplGamepadPlatform

enum fplGamepadPlatform

Target platform tag of a fplGamepadMapping (mirrors the SDL platform: field).

Name Description
fplGamepadPlatform_Unknown Platform was not specified or is not recognized.
fplGamepadPlatform_Windows Microsoft Windows.
fplGamepadPlatform_Linux Linux (joystick or evdev).
fplGamepadPlatform_MacOS Apple macOS.
fplGamepadPlatform_Android Android.
fplGamepadPlatform_iOS Apple iOS.

Definition at line 9432 of file final_platform_layer.h.

fplInputConnectionState

enum fplInputConnectionState

InputDeviceFeatureFlags operator overloads for C++.

Connection state of an input device.

Name Description
fplInputConnectionState_Unknown Connection state has not been determined.
fplInputConnectionState_Disconnected Device is not currently connected.
fplInputConnectionState_Connected Device is currently connected.

Definition at line 9572 of file final_platform_layer.h.

fplInputDeviceFeatureFlags

enum fplInputDeviceFeatureFlags

Bitmask describing the features a single fplInputDevice supports.

Name Description
fplInputDeviceFeatureFlags_None No features.
fplInputDeviceFeatureFlags_Polling Device can be polled for state.
fplInputDeviceFeatureFlags_Events Device can produce events.
fplInputDeviceFeatureFlags_Hotplug Device participates in hotplug notifications.

Definition at line 9555 of file final_platform_layer.h.

fplKey

enum fplKey

An enumeration of mapped keys (Based on MS Virtual-Key-Codes, mostly directly mapped from ASCII).

Name Description
fplKey_None 0x00: None
fplKey_Backspace Backspace key.
fplKey_Tab Tab key.
fplKey_Clear Clear key.
fplKey_Return Return key.
fplKey_Shift Shift key.
fplKey_Control Control key.
fplKey_Alt Alt key.
fplKey_Pause Pause key.
fplKey_CapsLock Caps Lock key.
fplKey_Escape Escape key.
fplKey_Space Space key.
fplKey_PageUp Page Up key.
fplKey_PageDown Page Down key.
fplKey_End End key.
fplKey_Home Home key.
fplKey_Left Left arrow key.
fplKey_Up Up arrow key.
fplKey_Right Right arrow key.
fplKey_Down Down arrow key.
fplKey_Select Select key.
fplKey_Print Print key.
fplKey_Execute Execute key.
fplKey_Snapshot Snapshot key.
fplKey_Insert Insert key.
fplKey_Delete Delete key.
fplKey_Help Help key.
fplKey_0 Number 0 key.
fplKey_1 Number 1 key.
fplKey_2 Number 2 key.
fplKey_3 Number 3 key.
fplKey_4 Number 4 key.
fplKey_5 Number 5 key.
fplKey_6 Number 6 key.
fplKey_7 Number 7 key.
fplKey_8 Number 8 key.
fplKey_9 Number 9 key.
fplKey_A Letter A key.
fplKey_B Letter B key.
fplKey_C Letter C key.
fplKey_D Letter D key.
fplKey_E Letter E key.
fplKey_F Letter F key.
fplKey_G Letter G key.
fplKey_H Letter H key.
fplKey_I Letter I key.
fplKey_J Letter J key.
fplKey_K Letter K key.
fplKey_L Letter L key.
fplKey_M Letter M key.
fplKey_N Letter N key.
fplKey_O Letter O key.
fplKey_P Letter P key.
fplKey_Q Letter Q key.
fplKey_R Letter R key.
fplKey_S Letter S key.
fplKey_T Letter T key.
fplKey_U Letter U key.
fplKey_V Letter V key.
fplKey_W Letter W key.
fplKey_X Letter X key.
fplKey_Y Letter Y key.
fplKey_Z Letter Z key.
fplKey_LeftSuper Left Super key.
fplKey_RightSuper Right Super key.
fplKey_Apps Apps key.
fplKey_Sleep Sleep key.
fplKey_NumPad0 NumPad 0 key.
fplKey_NumPad1 NumPad 1 key.
fplKey_NumPad2 NumPad 2 key.
fplKey_NumPad3 NumPad 3 key.
fplKey_NumPad4 NumPad 4 key.
fplKey_NumPad5 NumPad 5 key.
fplKey_NumPad6 NumPad 6 key.
fplKey_NumPad7 NumPad 7 key.
fplKey_NumPad8 NumPad 8 key.
fplKey_NumPad9 NumPad 9 key.
fplKey_Multiply Multiply key.
fplKey_Add Add key.
fplKey_Separator Separator key.
fplKey_Substract Subtract key.
fplKey_Decimal Decimal key.
fplKey_Divide Divide key.
fplKey_F1 Function key F1.
fplKey_F2 Function key F2.
fplKey_F3 Function key F3.
fplKey_F4 Function key F4.
fplKey_F5 Function key F5.
fplKey_F6 Function key F6.
fplKey_F7 Function key F7.
fplKey_F8 Function key F8.
fplKey_F9 Function key F9.
fplKey_F10 Function key F10.
fplKey_F11 Function key F11.
fplKey_F12 Function key F12.
fplKey_F13 Function key F13.
fplKey_F14 Function key F14.
fplKey_F15 Function key F15.
fplKey_F16 Function key F16.
fplKey_F17 Function key F17.
fplKey_F18 Function key F18.
fplKey_F19 Function key F19.
fplKey_F20 Function key F20.
fplKey_F21 Function key F21.
fplKey_F22 Function key F22.
fplKey_F23 Function key F23.
fplKey_F24 Function key F24.
fplKey_NumLock Num Lock key.
fplKey_Scroll Scroll Lock key.
fplKey_LeftShift Left Shift key.
fplKey_RightShift Right Shift key.
fplKey_LeftControl Left Control key.
fplKey_RightControl Right Control key.
fplKey_LeftAlt Left Alt key.
fplKey_RightAlt Right Alt key.
fplKey_VolumeMute Volume Mute key.
fplKey_VolumeDown Volume Down key.
fplKey_VolumeUp Volume Up key.
fplKey_MediaNextTrack Media Next Track key.
fplKey_MediaPrevTrack Media Previous Track key.
fplKey_MediaStop Media Stop key.
fplKey_MediaPlayPause Media Play/Pause key.
fplKey_Oem1 '/?' for US.
fplKey_OemPlus '+' for any country.
fplKey_OemComma ',' for any country.
fplKey_OemMinus '-' for any country.
fplKey_OemPeriod '.' for any country.
fplKey_Oem2 '/?' for US.
fplKey_Oem3 '`~' for US.
fplKey_Oem4 '[{' for US.
fplKey_Oem5 '|' for US.
fplKey_Oem6 ']}' for US.
fplKey_Oem7 ''"' for US.
fplKey_Oem8 OEM specific key.
fplKey_Last Last key.
fplKey_First First key.

Definition at line 8724 of file final_platform_layer.h.

fplKeyboardModifierFlags

enum fplKeyboardModifierFlags

An enumeration of keyboard modifier flags.

Name Description
fplKeyboardModifierFlags_None No modifiers.
fplKeyboardModifierFlags_LAlt Left alt key is down.
fplKeyboardModifierFlags_RAlt Right alt key is down.
fplKeyboardModifierFlags_LCtrl Left ctrl key is down.
fplKeyboardModifierFlags_RCtrl Right ctrl key is down.
fplKeyboardModifierFlags_LShift Left shift key is down.
fplKeyboardModifierFlags_RShift Right shift key is down.
fplKeyboardModifierFlags_LSuper Left super key is down.
fplKeyboardModifierFlags_RSuper Right super key is down.
fplKeyboardModifierFlags_CapsLock Capslock state is active.
fplKeyboardModifierFlags_NumLock Numlock state is active.
fplKeyboardModifierFlags_ScrollLock Scrolllock state is active.

Definition at line 9061 of file final_platform_layer.h.

fplMouseButtonType

enum fplMouseButtonType

An enumeration of mouse button types (Left, Right, etc.).

Name Description
fplMouseButtonType_None No mouse button.
fplMouseButtonType_Left Left mouse button.
fplMouseButtonType_Right Right mouse button.
fplMouseButtonType_Middle Middle mouse button.
fplMouseButtonType_X1 First extended mouse button (typically "back").
fplMouseButtonType_X2 Second extended mouse button (typically "forward").
fplMouseButtonType_MaxCount Max mouse button count.

Definition at line 9120 of file final_platform_layer.h.

Function Documentation

fplFindInputDevice()

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.

fplGamepadMappingApply()

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.

fplGamepadMappingApplyDefault()

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.

fplGetInputBackendSupport()

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

outSupports is null.

fplGetInputBackendSupportByType()

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.

fplGetInputDevices()

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.

fplKeyGetName()

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.

fplPollGamepadStates()

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

fplPollKeyboardState()

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

fplPollMouseState()

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

fplUpdateInputDevices()

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.

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally