| 1 | |
| 2 | <refentry id="button"> |
| 3 | <indexterm id="IndexButton"><primary>button</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>button</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>button</refname> |
| 11 | <refpurpose> |
| 12 | Sense on-screen controls. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Sense on-screen controls. Requires Winsound or TCL/TK. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>kres <command>button</command> knum</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Performance</title> |
| 30 | <para> |
| 31 | Note that this opcode is not available on Windows due to the implimentation of pipes on that system |
| 32 | </para> |
| 33 | <para> |
| 34 | <emphasis>kres</emphasis> -- value of the button control. If the button has been pushed since the last k-period, then return 1, otherwise return 0. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>knum</emphasis> -- the number of the button. If it does not exist, it is made on-screen at initialization. |
| 39 | </para> |
| 40 | </refsect1> |
| 41 | |
| 42 | <refsect1> |
| 43 | <title>Examples</title> |
| 44 | <para> |
| 45 | Here is a simple example of the checkbox opcode. It uses the file <ulink url="examples/checkbox.csd"><citetitle>checkbox.csd</citetitle></ulink>. |
| 46 | |
| 47 | <example> |
| 48 | <title>Simple example of the checkbox opcode.</title> |
| 49 | |
| 50 | |
| 51 | |
| 52 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 53 | <xi:include href="examples-xml/checkbox.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 54 | </example> |
| 55 | </para> |
| 56 | </refsect1> |
| 57 | |
| 58 | <refsect1> |
| 59 | <title>See also</title> |
| 60 | <para><link linkend="ControlSensing"><citetitle>Sensing and Control: TCL/TK widgets</citetitle></link></para> |
| 61 | </refsect1> |
| 62 | |
| 63 | <refsect1> |
| 64 | <title>Credits</title> |
| 65 | <para> |
| 66 | <simplelist> |
| 67 | <member>Author: &namejohn;</member> |
| 68 | <member>University of Bath, Codemist. Ltd.</member> |
| 69 | <member>Bath, UK</member> |
| 70 | <member>September 2000</member> |
| 71 | </simplelist> |
| 72 | </para> |
| 73 | |
| 74 | <para>New in Csound version 4.08</para> |
| 75 | </refsect1> |
| 76 | </refentry> |