Game Controller main interface
The main interface to use the Game Controller library.
Summary
Typedefs |
|
---|---|
Paddleboat_ControllerStatusCallback)(const int32_t controllerIndex, const Paddleboat_ControllerStatus controllerStatus, void *userData)
|
typedefvoid(*
Signature of a function that can be passed to Paddleboat_setControllerStatusCallback to receive information about controller connections and disconnections. |
Paddleboat_Controller_Battery
|
typedef A structure that describes the current battery state of a controller. |
Paddleboat_Controller_Data
|
typedefstruct Paddleboat_Controller_Data
A structure that contains the current data for a controller's inputs and sensors. |
Paddleboat_Controller_Info
|
typedefstruct Paddleboat_Controller_Info
A structure that contains information about a particular controller device. |
Paddleboat_Controller_Mapping_Data
|
typedef
Deprecated.
Use the Paddleboat_Controller_Mapping_File_Header in combination with the Paddleboat_addControllerRemapDataFromFileBuffer function instead. A structure that describes the button and axis mappings for a specified controller device running on a specified range of Android API levels. |
Paddleboat_Controller_Pointer
|
typedef A structure that contains virtual pointer position data. |
Paddleboat_Controller_Thumbstick
|
typedef A structure that contains X and Y axis data for an analog thumbstick. |
Paddleboat_Controller_Thumbstick_Precision
|
typedef A structure that contains axis precision data for a thumbstick in the X and Y axis. |
Paddleboat_MotionDataCallback)(const int32_t controllerIndex, const Paddleboat_Motion_Data *motionData, void *userData)
|
typedefvoid(*
Signature of a function that can be passed to Paddleboat_setMotionDataCallback to receive information about motion data events sent by connected controllers. |
Paddleboat_Motion_Data
|
typedefstruct Paddleboat_Motion_Data
A structure that contains motion data reported by a controller. |
Paddleboat_MouseStatusCallback)(const Paddleboat_MouseStatus mouseStatus, void *userData)
|
typedefvoid(*
Signature of a function that can be passed to Paddleboat_setMouseStatusCallback to receive information about mouse device status changes. |
Paddleboat_Mouse_Data
|
typedefstruct Paddleboat_Mouse_Data
A structure that contains input data for the mouse device. |
Paddleboat_PhysicalKeyboardStatusCallback)(const bool physicalKeyboardStatus, void *userData)
|
typedefvoid(*
Signature of a function that can be passed to Paddleboat_setPhysicalKeyboardStatusCallback to receive information about physical keyboard connection status changes. |
Paddleboat_Vibration_Data
|
typedefstruct Paddleboat_Vibration_Data
A structure that describes the parameters of a vibration effect. |
Functions |
|
---|---|
Paddleboat_addControllerRemapData(const Paddleboat_Remap_Addition_Mode addMode, const int32_t remapTableEntryCount, const Paddleboat_Controller_Mapping_Data *mappingData)
|
void
Add new controller remap information to the internal remapping table. |
Paddleboat_addControllerRemapDataFromFd(const Paddleboat_Remap_Addition_Mode addMode, const int mappingFileDescriptor)
|
Add new controller remap information to the internal remapping table.
|
Paddleboat_addControllerRemapDataFromFileBuffer(const Paddleboat_Remap_Addition_Mode addMode, const void *mappingFileBuffer, const size_t mappingFileBufferSize)
|
Add new controller remap information to the internal remapping table.
|
Paddleboat_destroy(JNIEnv *env)
|
void
Destroy resources that Paddleboat has created.
|
Paddleboat_getActiveAxisMask()
|
uint64_t
Retrieve the active axis ids being used by connected devices.
|
Paddleboat_getBackButtonConsumed()
|
bool
Get whether Paddleboat consumes AKEYCODE_BACK key events from devices being managed by Paddleboat.
|
Paddleboat_getControllerData(const int32_t controllerIndex, Paddleboat_Controller_Data *controllerData)
|
Retrieve the current controller data from the controller with the specified index.
|
Paddleboat_getControllerInfo(const int32_t controllerIndex, Paddleboat_Controller_Info *controllerInfo)
|
Retrieve the current controller device info from the controller with the specified index.
|
Paddleboat_getControllerName(const int32_t controllerIndex, const size_t bufferSize, char *controllerName)
|
Retrieve the current controller name from the controller with the specified index.
|
Paddleboat_getControllerRemapTableData(const int32_t destRemapTableEntryCount, Paddleboat_Controller_Mapping_Data *mappingData)
|
int32_t
Retrieve the current table of controller remap entries. |
Paddleboat_getControllerStatus(const int32_t controllerIndex)
|
Retrieve the current controller device info from the controller with the specified index.
|
Paddleboat_getIntegratedMotionSensorFlags()
|
Get availability information for motion data sensors integrated directly on the main device, instead of attached to a controller.
|
Paddleboat_getLastKeycode()
|
int32_t
An function that returns the last keycode seen in a key event coming from a controller owned by Paddleboat.
|
Paddleboat_getMouseData(Paddleboat_Mouse_Data *mouseData)
|
Retrieve the current mouse data.
|
Paddleboat_getMouseStatus()
|
Retrieve the current controller device info from the controller with the specified index.
|
Paddleboat_getPhysicalKeyboardStatus()
|
bool
Retrieve the physical keyboard connection status for the device.
|
Paddleboat_init(JNIEnv *env, jobject jcontext)
|
Initialize Paddleboat, constructing internal resources via JNI.
|
Paddleboat_isInitialized()
|
bool
Check if Paddleboat was successfully initialized.
|
Paddleboat_onStart(JNIEnv *env)
|
void
Inform Paddleboat that a start event was sent to the application.
|
Paddleboat_onStop(JNIEnv *env)
|
void
Inform Paddleboat that a stop event was sent to the application.
|
Paddleboat_processGameActivityKeyInputEvent(const void *event, const size_t eventSize)
|
int32_t
Process a GameActivityKeyEvent input event to see if it is from a device being managed by Paddleboat.
|
Paddleboat_processGameActivityMotionInputEvent(const void *event, const size_t eventSize)
|
int32_t
Process a GameActivityMotionEvent input event to see if it is from a device being managed by Paddleboat.
|
Paddleboat_processInputEvent(const AInputEvent *event)
|
int32_t
Process an input event to see if it is from a device being managed by Paddleboat.
|
Paddleboat_setBackButtonConsumed(bool consumeBackButton)
|
void
Set whether Paddleboat consumes AKEYCODE_BACK key events from devices being managed by Paddleboat.
|
Paddleboat_setControllerLight(const int32_t controllerIndex, const Paddleboat_LightType lightType, const uint32_t lightData, JNIEnv *env)
|
Configures a light on the controller with the specified index.
|
Paddleboat_setControllerStatusCallback(Paddleboat_ControllerStatusCallback statusCallback, void *userData)
|
void
Set a callback to be called whenever a controller managed by Paddleboat changes status.
|
Paddleboat_setControllerVibrationData(const int32_t controllerIndex, const Paddleboat_Vibration_Data *vibrationData, JNIEnv *env)
|
Set vibration data for the controller with the specified index.
|
Paddleboat_setMotionDataCallback(Paddleboat_MotionDataCallback motionDataCallback, void *userData)
|
void
Set a callback which is called whenever a controller managed by Paddleboat reports a motion data event.
|
Paddleboat_setMotionDataCallbackWithIntegratedFlags(Paddleboat_MotionDataCallback motionDataCallback, Paddleboat_Integrated_Motion_Sensor_Flags integratedSensorFlags, void *userData)
|
Set a callback which is called whenever a controller managed by Paddleboat reports a motion data event.
|
Paddleboat_setMouseStatusCallback(Paddleboat_MouseStatusCallback statusCallback, void *userData)
|
void
Set a callback to be called when the mouse status changes.
|
Paddleboat_setPhysicalKeyboardStatusCallback(Paddleboat_PhysicalKeyboardStatusCallback statusCallback, void *userData)
|
void
Set a callback to be called when the physical keyboard connection.
|
Paddleboat_update(JNIEnv *env)
|
void
Updates internal Paddleboat status and processes pending connection/disconnections.
|
Macros |
|
---|---|
PADDLEBOAT_BUGFIX_VERSION 0
|
|
PADDLEBOAT_MAJOR_VERSION 2
|
|
PADDLEBOAT_MAPPING_FILE_IDENTIFIER 0xadd1eb0a
|
The expected value in the
fileIdentifier field of the Paddleboat_Controller_Mapping_File_Header for a valid mapping file. |
PADDLEBOAT_MAX_CONTROLLERS 8
|
Maximum number of simultaneously connected controllers.
|
PADDLEBOAT_MINOR_VERSION 1
|
|
PADDLEBOAT_PACKED_VERSION ANDROID_GAMESDK_PACKED_VERSION(PADDLEBOAT_MAJOR_VERSION, \
PADDLEBOAT_MINOR_VERSION, \
PADDLEBOAT_BUGFIX_VERSION)
|
|
PADDLEBOAT_STRING_TABLE_ENTRY_MAX_SIZE 64
|
The maximum number of characters, including the terminating character, allowed in a string table entry.
|
Structs |
|
---|---|
Paddleboat_Controller_Battery |
A structure that describes the current battery state of a controller. |
Paddleboat_Controller_Data |
A structure that contains the current data for a controller's inputs and sensors. |
Paddleboat_Controller_Info |
A structure that contains information about a particular controller device. |
Paddleboat_Controller_Mapping_Data |
A structure that describes the button and axis mappings for a specified controller device running on a specified range of Android API levels. |
Paddleboat_Controller_Pointer |
A structure that contains virtual pointer position data. |
Paddleboat_Controller_Thumbstick |
A structure that contains X and Y axis data for an analog thumbstick. |
Paddleboat_Controller_Thumbstick_Precision |
A structure that contains axis precision data for a thumbstick in the X and Y axis. |
Paddleboat_Motion_Data |
A structure that contains motion data reported by a controller. |
Paddleboat_Mouse_Data |
A structure that contains input data for the mouse device. |
Paddleboat_Vibration_Data |
A structure that describes the parameters of a vibration effect. |
Enumerations
Paddleboat_BatteryStatus
Paddleboat_BatteryStatus
Battery status of a controller.
Paddleboat_Buttons
Paddleboat_Buttons
Paddleboat controller buttons defined as bitmask values.
AND against Paddleboat_Controller_Data.buttonsDown
to check for button status.
Properties | |
---|---|
PADDLEBOAT_BUTTON_A
|
Bitmask for |
PADDLEBOAT_BUTTON_AUX1
|
Bitmask for |
PADDLEBOAT_BUTTON_AUX2
|
Bitmask for |
PADDLEBOAT_BUTTON_AUX3
|
Bitmask for |
PADDLEBOAT_BUTTON_AUX4
|
Bitmask for |
PADDLEBOAT_BUTTON_B
|
Bitmask for |
PADDLEBOAT_BUTTON_COUNT
|
Count of defined controller buttons. |
PADDLEBOAT_BUTTON_DPAD_DOWN
|
Bitmask for |
PADDLEBOAT_BUTTON_DPAD_LEFT
|
Bitmask for |
PADDLEBOAT_BUTTON_DPAD_RIGHT
|
Bitmask for |
PADDLEBOAT_BUTTON_DPAD_UP
|
Bitmask for |
PADDLEBOAT_BUTTON_L1
|
Bitmask for |
PADDLEBOAT_BUTTON_L2
|
Bitmask for |
PADDLEBOAT_BUTTON_L3
|
Bitmask for |
PADDLEBOAT_BUTTON_R1
|
Bitmask for |
PADDLEBOAT_BUTTON_R2
|
Bitmask for |
PADDLEBOAT_BUTTON_R3
|
Bitmask for |
PADDLEBOAT_BUTTON_SELECT
|
Bitmask for |
PADDLEBOAT_BUTTON_START
|
Bitmask for |
PADDLEBOAT_BUTTON_SYSTEM
|
Bitmask for |
PADDLEBOAT_BUTTON_TOUCHPAD
|
Bitmask for |
PADDLEBOAT_BUTTON_X
|
Bitmask for |
PADDLEBOAT_BUTTON_Y
|
Bitmask for |
Paddleboat_ControllerButtonLayout
Paddleboat_ControllerButtonLayout
The button layout and iconography of the controller buttons.
Properties | |
---|---|
PADDLEBOAT_CONTROLLER_LAYOUT_ARCADE_STICK
|
X Y R1 L1 |
PADDLEBOAT_CONTROLLER_LAYOUT_MASK
|
Mask value, AND with |
PADDLEBOAT_CONTROLLER_LAYOUT_REVERSE
|
X |
PADDLEBOAT_CONTROLLER_LAYOUT_SHAPES
|
△ |
PADDLEBOAT_CONTROLLER_LAYOUT_STANDARD
|
Y |
Paddleboat_ControllerStatus
Paddleboat_ControllerStatus
Current status of a controller (at a specified controller index)
Paddleboat_Controller_Flags
Paddleboat_Controller_Flags
Paddleboat controller device feature flags as bitmask values AND against Paddleboat_Controller_Info.controllerFlags
to determine feature availability.
Properties | |
---|---|
PADDLEBOAT_CONTROLLER_FLAG_ACCELEROMETER
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_BATTERY
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_GENERIC_PROFILE
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_GYROSCOPE
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_LIGHT_PLAYER
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_LIGHT_RGB
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_TOUCHPAD
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_VIBRATION
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_VIBRATION_DUAL_MOTOR
|
Bitmask for |
PADDLEBOAT_CONTROLLER_FLAG_VIRTUAL_MOUSE
|
Bitmask for |
Paddleboat_ErrorCode
Paddleboat_ErrorCode
Paddleboat error code results.
Properties | |
---|---|
PADDLEBOAT_ERROR_ALREADY_INITIALIZED
|
Paddleboat_init was called a second time without a call to Paddleboat_destroy in between. |
PADDLEBOAT_ERROR_FEATURE_NOT_SUPPORTED
|
The feature is not supported by the specified controller. Example: Calling Paddleboat_setControllerVibrationData on a controller that does not have the |
PADDLEBOAT_ERROR_FILE_IO
|
A file I/O error occurred when trying to read mapping data from the file descriptor passed to Paddleboat_addControllerRemapDataFromFd. |
PADDLEBOAT_ERROR_INIT_GCM_FAILURE
|
Paddleboat could not be successfully initialized. Instantiation of the GameControllerManager class failed. |
PADDLEBOAT_ERROR_INVALID_CONTROLLER_INDEX
|
Invalid controller index specified. Valid index range is from 0 to PADDLEBOAT_MAX_CONTROLLERS - 1 |
PADDLEBOAT_ERROR_INVALID_PARAMETER
|
An invalid parameter was specified. This usually means NULL or nullptr was passed in a parameter that requires a valid pointer. |
PADDLEBOAT_ERROR_NOT_INITIALIZED
|
Paddleboat was not successfully initialized. Either Paddleboat_init was not called or returned an error. |
PADDLEBOAT_ERROR_NO_CONTROLLER
|
No controller is connected at the specified controller index. |
PADDLEBOAT_ERROR_NO_MOUSE
|
No virtual or physical mouse device is connected. |
PADDLEBOAT_INCOMPATIBLE_MAPPING_DATA
|
Incompatible controller mapping data was provided. The data in the provided buffer is from an incompatible version of the mapping data format. |
PADDLEBOAT_INVALID_MAPPING_DATA
|
Invalid controller mapping data was provided. The data in the provided buffer does not match the expected mapping data format. |
PADDLEBOAT_NO_ERROR
|
No error. Function call was successful. |
Paddleboat_Ignored_Axis
Paddleboat_Ignored_Axis
Special constants to specify an axis or axis button mapping is ignored by the controller.
Properties | |
---|---|
PADDLEBOAT_AXIS_BUTTON_IGNORED
|
Constant that signifies an axis in the |
PADDLEBOAT_AXIS_IGNORED
|
Constant that signifies an axis in the |
Paddleboat_Ignored_Buttons
Paddleboat_Ignored_Buttons
Special constant to specify a button is ignored by the controller.
Properties | |
---|---|
PADDLEBOAT_BUTTON_IGNORED
|
Constant that signifies a button in the |
Paddleboat_Integrated_Motion_Sensor_Flags
Paddleboat_Integrated_Motion_Sensor_Flags
Bitmask values to use with Paddleboat_getIntegratedMotionSensorFlags and Paddleboat_setMotionDataCallbackWithIntegratedFlags Bitmask values represent integrated sensor types on the main device instead of a controller device.
Properties | |
---|---|
PADDLEBOAT_INTEGRATED_SENSOR_ACCELEROMETER
|
Bitmask for Paddleboat_getIntegratedMotionSensorFlags If set, the main device supports reporting accelerometer motion axis data. |
PADDLEBOAT_INTEGRATED_SENSOR_GYROSCOPE
|
Bitmask for Paddleboat_getIntegratedMotionSensorFlags If set, the main device supports reporting gyroscope motion axis data. |
PADDLEBOAT_INTEGRATED_SENSOR_NONE
|
Bitmask for Paddleboat_getIntegratedMotionSensorFlags No present integrated motion sensors. |
Paddleboat_LightType
Paddleboat_LightType
The type of light being specified by a call to Paddleboat_setControllerLight.
Properties | |
---|---|
PADDLEBOAT_LIGHT_PLAYER_NUMBER
|
Light is a player index, |
PADDLEBOAT_LIGHT_RGB
|
Light is a color light,.
|
Paddleboat_Mapping_Axis
Paddleboat_Mapping_Axis
Paddleboat axis mapping table axis order.
Paddleboat_Motion_Data_Callback_Sensor_Index
Paddleboat_Motion_Data_Callback_Sensor_Index
Bitmask flags to use with Paddleboat_getIntegratedMotionSensorFlags and Paddleboat_setMotionDataCallbackWithIntegratedFlags Flag values represent integrated sensor types on the main device instead of a controller device.
Properties | |
---|---|
PADDLEBOAT_INTEGRATED_SENSOR_INDEX
|
Value passed in the This value will only be passed to the motion data callback if integrated sensor data has been requested using Paddleboat_setMotionDataCallbackWithIntegratedFlags |
Paddleboat_Motion_Type
Paddleboat_Motion_Type
The type of motion data being reported in a Paddleboat_Motion_Data structure.
Properties | |
---|---|
PADDLEBOAT_MOTION_ACCELEROMETER
|
Accelerometer motion data. |
PADDLEBOAT_MOTION_GYROSCOPE
|
Gyroscope motion data. |
Paddleboat_MouseStatus
Paddleboat_MouseStatus
Paddleboat_Mouse_Buttons
Paddleboat_Mouse_Buttons
Paddleboat mouse buttons as bitmask values AND against Paddleboat_Mouse_Data.buttonsDown
to determine button status.
Properties | |
---|---|
PADDLEBOAT_MOUSE_BUTTON_6
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_7
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_8
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_BACK
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_FORWARD
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_LEFT
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_MIDDLE
|
Bitmask for |
PADDLEBOAT_MOUSE_BUTTON_RIGHT
|
Bitmask for |
Paddleboat_Remap_Addition_Mode
Paddleboat_Remap_Addition_Mode
The addition mode to use when passing new controller mapping data to Paddleboat_addControllerRemapData.
Typedefs
Paddleboat_ControllerStatusCallback
void(* Paddleboat_ControllerStatusCallback)(const int32_t controllerIndex, const Paddleboat_ControllerStatus controllerStatus, void *userData)
Signature of a function that can be passed to Paddleboat_setControllerStatusCallback to receive information about controller connections and disconnections.
Function will be called on the same thread that calls Paddleboat_update.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Paddleboat_Controller_Battery
struct Paddleboat_Controller_Battery Paddleboat_Controller_Battery
A structure that describes the current battery state of a controller.
This structure will only be populated if a controller has PADDLEBOAT_CONTROLLER_FLAG_BATTERY
set in Paddleboat_Controller_Info.controllerFlags
Paddleboat_Controller_Data
struct Paddleboat_Controller_Data Paddleboat_Controller_Data
A structure that contains the current data for a controller's inputs and sensors.
Paddleboat_Controller_Info
struct Paddleboat_Controller_Info Paddleboat_Controller_Info
A structure that contains information about a particular controller device.
Several fields are populated by the value of the corresponding fields from InputDevice.
Paddleboat_Controller_Mapping_Data
struct Paddleboat_Controller_Mapping_Data Paddleboat_Controller_Mapping_Data
A structure that describes the button and axis mappings for a specified controller device running on a specified range of Android API levels.
See Paddleboat_Mapping_Axis
for axis order. Hat axis should be mapped to dpad buttons.
Deprecated.
Use the Paddleboat_Controller_Mapping_File_Header
in combination with the Paddleboat_addControllerRemapDataFromFileBuffer function instead.
Paddleboat_Controller_Pointer
struct Paddleboat_Controller_Pointer Paddleboat_Controller_Pointer
A structure that contains virtual pointer position data.
X and Y coordinates are pixel based and range from 0,0 to window width,height.
Paddleboat_Controller_Thumbstick
struct Paddleboat_Controller_Thumbstick Paddleboat_Controller_Thumbstick
A structure that contains X and Y axis data for an analog thumbstick.
Axis ranges from -1.0 to 1.0.
Paddleboat_Controller_Thumbstick_Precision
struct Paddleboat_Controller_Thumbstick_Precision Paddleboat_Controller_Thumbstick_Precision
A structure that contains axis precision data for a thumbstick in the X and Y axis.
Value ranges from 0.0 to 1.0. Flat is the extent of a center flat (deadzone) area of a thumbstick axis Fuzz is the error tolerance (deviation) of a thumbstick axis
Paddleboat_MotionDataCallback
void(* Paddleboat_MotionDataCallback)(const int32_t controllerIndex, const Paddleboat_Motion_Data *motionData, void *userData)
Signature of a function that can be passed to Paddleboat_setMotionDataCallback to receive information about motion data events sent by connected controllers.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Paddleboat_Motion_Data
struct Paddleboat_Motion_Data Paddleboat_Motion_Data
A structure that contains motion data reported by a controller.
Paddleboat_MouseStatusCallback
void(* Paddleboat_MouseStatusCallback)(const Paddleboat_MouseStatus mouseStatus, void *userData)
Signature of a function that can be passed to Paddleboat_setMouseStatusCallback to receive information about mouse device status changes.
Function will be called on the same thread that calls Paddleboat_update.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Paddleboat_Mouse_Data
struct Paddleboat_Mouse_Data Paddleboat_Mouse_Data
A structure that contains input data for the mouse device.
Paddleboat_PhysicalKeyboardStatusCallback
void(* Paddleboat_PhysicalKeyboardStatusCallback)(const bool physicalKeyboardStatus, void *userData)
Signature of a function that can be passed to Paddleboat_setPhysicalKeyboardStatusCallback to receive information about physical keyboard connection status changes.
Function will be called on the same thread that calls Paddleboat_update.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Paddleboat_Vibration_Data
struct Paddleboat_Vibration_Data Paddleboat_Vibration_Data
A structure that describes the parameters of a vibration effect.
Functions
Paddleboat_addControllerRemapData
void Paddleboat_addControllerRemapData( const Paddleboat_Remap_Addition_Mode addMode, const int32_t remapTableEntryCount, const Paddleboat_Controller_Mapping_Data *mappingData )
Add new controller remap information to the internal remapping table.
Used to specify custom controller information or override default mapping for a given controller. Deprecated. Use Paddleboat_addControllerRemapDataFromFd or Paddleboat_addControllerRemapDataFromFileBuffer instead.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Paddleboat_addControllerRemapDataFromFd
Paddleboat_ErrorCode Paddleboat_addControllerRemapDataFromFd( const Paddleboat_Remap_Addition_Mode addMode, const int mappingFileDescriptor )
Add new controller remap information to the internal remapping table.
Used to specify custom controller information or override default mapping for a given controller. For more information on controller mapping, see the documentation at: https://developer.android.com/games/sdk/game-controller/custom-mapping
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
PADDLEBOAT_NO_ERROR if successful, otherwise an error code. |
Paddleboat_addControllerRemapDataFromFileBuffer
Paddleboat_ErrorCode Paddleboat_addControllerRemapDataFromFileBuffer( const Paddleboat_Remap_Addition_Mode addMode, const void *mappingFileBuffer, const size_t mappingFileBufferSize )
Add new controller remap information to the internal remapping table.
Used to specify custom controller information or override default mapping for a given controller. For more information on controller mapping, see the documentation at: https://developer.android.com/games/sdk/game-controller/custom-mapping
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
PADDLEBOAT_NO_ERROR if successful, otherwise an error code. |
Paddleboat_destroy
void Paddleboat_destroy( JNIEnv *env )
Destroy resources that Paddleboat has created.
See also: Paddleboat_init
Details | |||
---|---|---|---|
Parameters |
|
Paddleboat_getActiveAxisMask
uint64_t Paddleboat_getActiveAxisMask()
Retrieve the active axis ids being used by connected devices.
This can be used to determine what axis values to provide to GameActivityPointerInfo_enableAxis when GameActivity is being used.
Details | |
---|---|
Returns |
A bitmask of the active axis ids that have been used by connected devices during the current application session.
|
Paddleboat_getBackButtonConsumed
bool Paddleboat_getBackButtonConsumed()
Get whether Paddleboat consumes AKEYCODE_BACK key events from devices being managed by Paddleboat.
The default at initialization is true.
Details | |
---|---|
Returns |
If true, Paddleboat will consume AKEYCODE_BACK key events, if false it will pass them through.
|
Paddleboat_getControllerData
Paddleboat_ErrorCode Paddleboat_getControllerData( const int32_t controllerIndex, Paddleboat_Controller_Data *controllerData )
Retrieve the current controller data from the controller with the specified index.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
PADDLEBOAT_NO_ERROR if data was successfully read. |
Paddleboat_getControllerInfo
Paddleboat_ErrorCode Paddleboat_getControllerInfo( const int32_t controllerIndex, Paddleboat_Controller_Info *controllerInfo )
Retrieve the current controller device info from the controller with the specified index.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
true if the data was read, false if there was no connected controller at the specified index.
|
Paddleboat_getControllerName
Paddleboat_ErrorCode Paddleboat_getControllerName( const int32_t controllerIndex, const size_t bufferSize, char *controllerName )
Retrieve the current controller name from the controller with the specified index.
This name is retrieved from InputDevice.getName().
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
PADDLEBOAT_NO_ERROR if data was successfully read. |
Paddleboat_getControllerRemapTableData
int32_t Paddleboat_getControllerRemapTableData( const int32_t destRemapTableEntryCount, Paddleboat_Controller_Mapping_Data *mappingData )
Retrieve the current table of controller remap entries.
Deprecated. The number of elements returned will always be zero.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
The number of elements in the internal remap table.
|
Paddleboat_getControllerStatus
Paddleboat_ControllerStatus Paddleboat_getControllerStatus( const int32_t controllerIndex )
Retrieve the current controller device info from the controller with the specified index.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Paddleboat_ControllerStatus enum value of the current controller status of the specified controller index.
|
Paddleboat_getIntegratedMotionSensorFlags
Paddleboat_Integrated_Motion_Sensor_Flags Paddleboat_getIntegratedMotionSensorFlags()
Get availability information for motion data sensors integrated directly on the main device, instead of attached to a controller.
Details | |
---|---|
Returns |
The bitmask of integrated motion data sensors.
|
Paddleboat_getLastKeycode
int32_t Paddleboat_getLastKeycode()
An function that returns the last keycode seen in a key event coming from a controller owned by Paddleboat.
Useful for debugging unknown buttons in new devices in the sample app
Details | |
---|---|
Returns |
keycode from last controller key event.
|
Paddleboat_getMouseData
Paddleboat_ErrorCode Paddleboat_getMouseData( Paddleboat_Mouse_Data *mouseData )
Retrieve the current mouse data.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
true if the data was read, false if there was no connected mouse device.
|
Paddleboat_getMouseStatus
Paddleboat_MouseStatus Paddleboat_getMouseStatus()
Retrieve the current controller device info from the controller with the specified index.
Details | |
---|---|
Returns |
Paddleboat_MouseStatus enum value of the current mouse status.
|
Paddleboat_getPhysicalKeyboardStatus
bool Paddleboat_getPhysicalKeyboardStatus()
Retrieve the physical keyboard connection status for the device.
Details | |
---|---|
Returns |
Whether a physical keyboard is currently connected, as boolean.
|
Paddleboat_init
Paddleboat_ErrorCode Paddleboat_init( JNIEnv *env, jobject jcontext )
Initialize Paddleboat, constructing internal resources via JNI.
This may be called after calling Paddleboat_destroy to reinitialize the library. See also:Paddleboat_destroy
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
PADDLEBOAT_NO_ERROR if successful, otherwise an error code relating to initialization failure. |
Paddleboat_isInitialized
bool Paddleboat_isInitialized()
Check if Paddleboat was successfully initialized.
Details | |
---|---|
Returns |
false if the initialization failed or was not called.
|
Paddleboat_onStart
void Paddleboat_onStart( JNIEnv *env )
Inform Paddleboat that a start event was sent to the application.
Details | |||
---|---|---|---|
Parameters |
|
Paddleboat_onStop
void Paddleboat_onStop( JNIEnv *env )
Inform Paddleboat that a stop event was sent to the application.
Details | |||
---|---|---|---|
Parameters |
|
Paddleboat_processGameActivityKeyInputEvent
int32_t Paddleboat_processGameActivityKeyInputEvent( const void *event, const size_t eventSize )
Process a GameActivityKeyEvent input event to see if it is from a device being managed by Paddleboat.
At least once per game frame, the game should iterate through reported GameActivityKeyEvents and pass them to Paddleboat_processGameActivityKeyInputEvent for evaluation.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
0 if the event was ignored, 1 if the event was processed/consumed by Paddleboat.
|
Paddleboat_processGameActivityMotionInputEvent
int32_t Paddleboat_processGameActivityMotionInputEvent( const void *event, const size_t eventSize )
Process a GameActivityMotionEvent input event to see if it is from a device being managed by Paddleboat.
At least once per game frame, the game should iterate through reported GameActivityMotionEvents and pass them to Paddleboat_processGameActivityMotionInputEvent for evaluation.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
0 if the event was ignored, 1 if the event was processed/consumed by Paddleboat.
|
Paddleboat_processInputEvent
int32_t Paddleboat_processInputEvent( const AInputEvent *event )
Process an input event to see if it is from a device being managed by Paddleboat.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
0 if the event was ignored, 1 if the event was processed/consumed by Paddleboat.
|
Paddleboat_setBackButtonConsumed
void Paddleboat_setBackButtonConsumed( bool consumeBackButton )
Set whether Paddleboat consumes AKEYCODE_BACK key events from devices being managed by Paddleboat.
The default at initialization is true. This can be set to false to allow exiting the application from a back button press when the application is in an appropriate state (i.e. the title screen).
Details | |||
---|---|---|---|
Parameters |
|
Paddleboat_setControllerLight
Paddleboat_ErrorCode Paddleboat_setControllerLight( const int32_t controllerIndex, const Paddleboat_LightType lightType, const uint32_t lightData, JNIEnv *env )
Configures a light on the controller with the specified index.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
PADDLEBOAT_NO_ERROR if successful, otherwise an error code. |
Paddleboat_setControllerStatusCallback
void Paddleboat_setControllerStatusCallback( Paddleboat_ControllerStatusCallback statusCallback, void *userData )
Set a callback to be called whenever a controller managed by Paddleboat changes status.
This is used to inform of controller connections and disconnections.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Paddleboat_setControllerVibrationData
Paddleboat_ErrorCode Paddleboat_setControllerVibrationData( const int32_t controllerIndex, const Paddleboat_Vibration_Data *vibrationData, JNIEnv *env )
Set vibration data for the controller with the specified index.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
true if the vibration data was set, false if there was no connected controller or the connected controller does not support vibration.
|
Paddleboat_setMotionDataCallback
void Paddleboat_setMotionDataCallback( Paddleboat_MotionDataCallback motionDataCallback, void *userData )
Set a callback which is called whenever a controller managed by Paddleboat reports a motion data event.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Paddleboat_setMotionDataCallbackWithIntegratedFlags
Paddleboat_ErrorCode Paddleboat_setMotionDataCallbackWithIntegratedFlags( Paddleboat_MotionDataCallback motionDataCallback, Paddleboat_Integrated_Motion_Sensor_Flags integratedSensorFlags, void *userData )
Set a callback which is called whenever a controller managed by Paddleboat reports a motion data event.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
PADDLEBOAT_NO_ERROR if the callback was successfully registered, otherwise an error code. Attempting to register integrated sensor reporting if the specified sensor is not present will result in a PADDLEBOAT_ERROR_FEATURE_NOT_SUPPORTED error code. |
Paddleboat_setMouseStatusCallback
void Paddleboat_setMouseStatusCallback( Paddleboat_MouseStatusCallback statusCallback, void *userData )
Set a callback to be called when the mouse status changes.
This is used to inform of physical or virual mouse device connections and disconnections.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Paddleboat_setPhysicalKeyboardStatusCallback
void Paddleboat_setPhysicalKeyboardStatusCallback( Paddleboat_PhysicalKeyboardStatusCallback statusCallback, void *userData )
Set a callback to be called when the physical keyboard connection.
status changes. This is used to inform of connections or disconnections of a physical keyboard to the primary device.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Paddleboat_update
void Paddleboat_update( JNIEnv *env )
Updates internal Paddleboat status and processes pending connection/disconnections.
Paddleboat_update is responsible for triggering any registered controller or mouse status callbacks, those callbacks will fire on the same thread that called Paddleboat_update. This function should be called once per game frame. It is recommended to call Paddleboat_update before sending any new input events or reading controller inputs for a particular game frame.
Details | |||
---|---|---|---|
Parameters |
|
Macros
PADDLEBOAT_BUGFIX_VERSION
PADDLEBOAT_BUGFIX_VERSION 0
PADDLEBOAT_MAJOR_VERSION
PADDLEBOAT_MAJOR_VERSION 2
PADDLEBOAT_MAPPING_FILE_IDENTIFIER
PADDLEBOAT_MAPPING_FILE_IDENTIFIER 0xadd1eb0a
The expected value in the fileIdentifier
field of the Paddleboat_Controller_Mapping_File_Header
for a valid mapping file.
PADDLEBOAT_MAX_CONTROLLERS
PADDLEBOAT_MAX_CONTROLLERS 8
Maximum number of simultaneously connected controllers.
PADDLEBOAT_MINOR_VERSION
PADDLEBOAT_MINOR_VERSION 1
PADDLEBOAT_PACKED_VERSION
PADDLEBOAT_PACKED_VERSION ANDROID_GAMESDK_PACKED_VERSION(PADDLEBOAT_MAJOR_VERSION, \ PADDLEBOAT_MINOR_VERSION, \ PADDLEBOAT_BUGFIX_VERSION)
PADDLEBOAT_STRING_TABLE_ENTRY_MAX_SIZE
PADDLEBOAT_STRING_TABLE_ENTRY_MAX_SIZE 64
The maximum number of characters, including the terminating character, allowed in a string table entry.