Getxpad

Reads Xbox-style controller state from the graphics library.

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction Getxpad ( KeyPgByvalByVal id KeyPgAsAs KeyPgLongLong, KeyPgByrefByRef buttons KeyPgAsAs KeyPgIntegerInteger = 
	0, KeyPgByrefByRef leftx KeyPgAsAs KeyPgSingleSingle = 0, KeyPgByrefByRef lefty KeyPgAsAs KeyPgSingleSingle = 0, KeyPgByrefByRef rightx KeyPgAsAs 
	KeyPgSingleSingle = 0, KeyPgByrefByRef righty KeyPgAsAs KeyPgSingleSingle = 0, KeyPgByrefByRef lefttrigger KeyPgAsAs KeyPgSingleSingle = 0, 
	KeyPgByrefByRef righttrigger KeyPgAsAs KeyPgSingleSingle = 0, KeyPgByrefByRef dpad KeyPgAsAs KeyPgIntegerInteger = 0 ) KeyPgAsAs KeyPgLongLong

Usage
	status = Getxpad( id[, buttons[, leftx[, lefty[, rightx[, righty[, 
	lefttrigger[, righttrigger[, dpad]]]]]]]] )

Parameters
	id
		The controller number to query.  The valid range is platform 
		dependent.
	buttons
		A bit mask of XPAD_BUTTON_* values.
	leftx, lefty, rightx, righty
		Analog stick positions in the range -1.0 to 1.0.
	lefttrigger, righttrigger
		Trigger positions in the range 0.0 to 1.0.
	dpad
		A bit mask of XPAD_DPAD_* values.

Return Value
	Returns one of the XPAD_STATUS_* constants from fbgfx.bi:
		* XPAD_STATUS_MISSING (0)
		* XPAD_STATUS_CONNECTED (1)
		* XPAD_STATUS_DISCONNECTED (2)

Description
	Getxpad provides a stable Xbox-style controller layout across supported 
	backends.  It is separate from KeyPgGetjoystickGetJoystick because modern gamepads have 
	a conventional button, trigger, stick, and d-pad shape that maps poorly 
	to a generic axis list.

	The named XPAD_BUTTON_*, XPAD_DPAD_*, and XPAD_STATUS_* constants are 
	declared in fbgfx.bi under the FB namespace.  The function itself is an 
	intrinsic and does not require an include file to call.

Example
	See examples/xpad/first-pad.bas, examples/xpad/active-state.bas, and 
	examples/xpad/stick-view.bas.

Dialect Differences
	* Not available in the CompilerOptlang-lang qb dialect unless referenced with the 
	  alias __Getxpad.

Differences from QB
	* New to FreeBASIC.

See also
	* KeyPgGetjoystickGetJoystick
	* KeyPgMultikeyMultiKey
	* KeyPgGetmouseGetMouse

