<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="gamepad" module="" category="">
	<digest>
		Report gamepad controller events
	</digest>
	<description>
		Tracks and outputs the button, joystick, trigger, and sensor events from all connected gamepad controllers. Send a device control messages for haptic feedback rumble events and device led color with the senddevice message. The gamepad object is a lightweight wrapper for the Simple DirectMedia Layer 2.0 Library's gamepad implementation.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Interaction
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="message">
			<digest>
				control messages
			</digest>
			<description>
				Send a device control messages for haptic feedback rumble events and device led color with the senddevice message.
			</description>
		</inlet>
		<inlet id="1" type="message">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="list">
			<digest>
				event message
			</digest>
			<description>
			</description>
		</outlet>
		<outlet id="1" type="list">
			<digest>
				device info for event (<i>instance_id</i>  <i>device_index</i>  <i>controller_name</i>  <i>controller_type</i>)
			</digest>
			<description>
				As gamepad controllers generate events, the info for the event is output as a list of the form <i>instance_id</i>  <i>device_index</i>  <i>controller_name</i>  <i>controller_type</i> 
			</description>
		</outlet>
		<outlet id="2" type="message">
			<digest>
				dumpoutlet
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="senddevice">
			<arglist>
				<arg name="Device ID" type="int" optional="0" />
				<arg name="Message" type="symbol" optional="0" />
				<arg name="Value" type="list" optional="0" />
			</arglist>
			<digest>
				Send a device control messages for haptic feedback rumble events and device led color
			</digest>
			<description>
				The word <m>senddevice</m> followed by a number indicating the logical device ID will send the following message on to that device. If the device index is negative, the following message is sent to all devices. Possible messages are <m>led</m>, <m>rumble</m>, and <m>rumbletriggers</m>.				<p />
				The <m>led</m> message is followed by <i>red</i>, <i>green</i> and <i>blue</i> values in the range 0-1.
				<p />
				The <m>rumble</m> message is followed by <i>low</i>  <i>high</i> and <i>duration</i> values, where <i>low</i> represents the low frequency rumble amount in the range 0-1, <i>high</i> represents the high frequency rumble amount in the range 0-1, and <i>duration</i> is in milliseconds.
				<p />
				The <m>rumbletriggers</m> message is followed by <i>left</i>  <i>right</i> and <i>duration</i> values, where <i>left</i> represents the left trigger rumble amount in the range 0-1, <i>right</i> represents toe right trigger rumble amount in the range 0-1, and <i>duration</i> is in milliseconds.
			</description>
		</method>
		<method name="sendinstance">
			<arglist>
				<arg name="Instance ID" type="int" optional="0" />
				<arg name="Message" type="symbol" optional="0" />
				<arg name="Value" type="list" optional="0" />
			</arglist>
			<digest>
				Send a device control messages for haptic feedback rumble events and device led color
			</digest>
			<description>
				The <m>sendinstance</m> message has the same functionality of the <m>senddevice</m> message, but referenced using the unique gamepad instance id rather than the logical device ID.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="interval" get="1" set="1" type="float" size="1">
			<digest>
				Global polling interval (ms)
			</digest>
			<description>
				The global polling interval sets the rate at which the incoming gamepad controller event queue is being serviced. The default is 5 milliseconds. Changing this attribute will change it for all gamepad controller objects in all patches.
			</description>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="hi" />
		<seealso name="key" />
		<seealso name="keyup" />
	</seealsolist>
	<discussion>
		As gamepad controllers generate events they are output in the form <m>event_type</m>  <i>value</i>. Possible events are:
		<br />
		<m>axis_left_x</m>
		<br />
		<m>axis_left_y</m>
		<br />
		<m>axis_right_x</m>
		<br />
		<m>axis_right_y</m>
		<br />
		<m>axis_left_trigger</m>
		<br />
		<m>axis_right_trigger</m>
		<br />
		<m>button_a</m>
		<br />
		<m>button_b</m>
		<br />
		<m>button_x</m>
		<br />
		<m>button_y</m>
		<br />
		<m>button_dpad_up</m>
		<br />
		<m>button_dpad_down</m>
		<br />
		<m>button_dpad_left</m>
		<br />
		<m>button_dpad_right</m>
		<br />
		<m>button_left_shoulder</m>
		<br />
		<m>button_right_shoulder</m>
		<br />
		<m>button_left_stick</m>
		<br />
		<m>button_right_stick</m>
		<br />
		<m>button_start</m>
		<br />
		<m>button_back</m>
		<br />
		<m>button_guide</m>
		<br />
		<m>button_misc1</m>
		<br />
		<m>button_touchpad</m>
		<br />
		<m>sensor_gyro</m>
		<br />
		<m>sensor_accel</m>
		<br />
		<m>touchpad_up</m>
		<br />
		<m>touchpad_down</m>
		<br />
		<m>touchpad_motion</m> 
	</discussion>
</c74object>
