<?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="keyup" module="max" category="Interaction">
	<digest>
		Report key information on release
	</digest>
	<description>
		Tracks and outputs the key-codes, ASCII values, and modifier-key values of key releases on the computer keyboard.
	</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="INLET_TYPE">
			<digest>
				ASCII Code of Key Released
			</digest>
			<description>
				The <o>keyup</o> and <o>key</o> objects may be used to capture key presses on your computer keyboard. The objects will receive keyboard output only if its patcher window has focus (i.e., it is the topmost window).
				<br />
				<br />
				Note to Max for Live users: Given that the <o>keyup</o> object will only receive output if its patcher window has focus and the many uses that the keyboard already has within the Live application (both assigned keys and user-assignable keys), the use of the <o>keyup</o> object in Max for Live is strongly discouraged.
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Platform-Specific Keyboard Code of Key Released
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				ASCII Code of Key Released
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Platform-Specific Keyboard Code of Key Released
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				Modifier Keys of Key Released
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="OUTLET_TYPE">
			<digest>
				Platform-Independent Keyboard Code of Key Released
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="(keyboard)">
			<arglist />
			<digest>
				Output keystroke information
			</digest>
			<description>
				The input to <o>keyup</o> comes directly from the computer keyboard. There are no inlets.
			</description>
			<attributelist>
				<attribute name="documentable" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="keyup.png" caption="ASCII value is sent when key is released... Used with key to measure how long a key is down" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="atoi" />
		<seealso name="hi" />
		<seealso name="itoa" />
		<seealso name="key" />
		<seealso name="mousestate" />
		<seealso name="numkey" />
		<seealso name="spell" />
		<seealso name="sprintf" />
		<seealso name="basicchapter08" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Output is sent each time a key is released on the computer keyboard. For multi-key combinations (such as option-E followed by E on a Mac US keyboard), only the last key release will produce output.
				<br />
				Out left outlet: The Unicode value of the released key, in UTF-16. This outlet provides the ASCII value of the released key (i.e., it outputs the text character rather than the code for the key that was released).
				<br />
				Out second outlet: The platform-specific key code of the released key. The codes are specific to individual physical keyboards as well operating system. The values are derived from Apple's key-code definitions (e.g., a=0, s=1, d=2, f=3). This outlet is useful in situations where you want to identify the position of the key rather than the key which was released (for example, when implementing a musical keyboard using the computer keyboard). The values reported for a given key position will be fixed regardless of the language chosen, and regardless of the modifiers (e.g., the value reported when the key to the right of the left shift key is pressed will be 6 whether an English or a German keyboard layout is chosen.
				<br />
				Out third outlet: The output value is a set of bits representing the state of various modifier keys when the key was released. The value can be sent through the &amp; object to create toggles set by each modifier key. The numerical output of the right outlet is listed along with the argument to the &amp; object that will create a toggle:
				<br />
				Out left outlet: The ASCII value of the released key.
				<br />
				<br />
				Out middle outlet: The key code of the released key.
				<br />
				<br />
				Out right outlet: The output values can be sent through the <o>&amp;</o> object to create toggles set by each modifier key. The numerical output of the right outlet is listed along with the argument to the <o>&amp;</o> object that will create a toggle:
				<br />
				<br />
				<br />
				<br />
				key events: Outputs 128. Toggle = <i>&amp; 128</i> (reports 0 on Windows if a mouse button is down, always reports 0 on Macintosh)
				<br />
				Windows Control key: Outputs 384. Toggle = <i>&amp; 256</i> (system uses this so it is not reported)
				<br />
				Macintosh Command key: Outputs 384. Toggle = <i>&amp; 256</i> (system uses this so it is not reported)
				<br />
				Shift key: Outputs 640. Toggle = <i>&amp; 512</i> 				<br />
				Caps Lock key (on): Outputs 1152. Toggle = <i>&amp; 1024</i> 				<br />
				Windows Alt key: Outputs 2176. Toggle = <i>&amp; 2048</i> (on Windows the system uses this so it is not reported)
				<br />
				Macintosh Option key: Outputs 2176. Toggle = <i>&amp; 2048</i> 				<br />
				Windows R. Mouse Button: Outputs 4224. Toggle = <i>&amp; 4096</i> 				<br />
				Macintosh Control key: Outputs 4224. Toggle = <i>&amp; 4096</i> 				<br />
				Out fourth outlet: keyboard-independent key code as described <link name="keyboardcodes" module="core" type="vignette">here</link>.
			</description>
		</entry>
	</misc>
</c74object>
