Debian Codegraph @

opcodes/sensekey.xml

raw symbols SCIP
1
2 <refentry id="sensekey">
3 <indexterm id="IndexSensekey"><primary>sensekey</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>sensekey</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>sensekey</refname>
11 <refpurpose>
12 Returns the ASCII code of a key that has been pressed.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Returns the ASCII code of a key that has been pressed, or -1 if no key has been pressed.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>kres[, kkeydown] <command>sensekey</command></synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Performance</title>
30 <para>
31 <emphasis>kres</emphasis> - returns the ASCII value of a key which is pressed or released.
32 </para>
33 <para>
34 <emphasis>kkeydown</emphasis> - returns 1 if the key was pressed, 0 if it was released or if there is no key event.
35 </para>
36 <para>
37 <emphasis>kres</emphasis> can be used to read keyboard events from stdin and returns the ASCII value of any key that is pressed or released, or it returns -1 when there is no keyboard activity. The value of <emphasis>kkeydown</emphasis> is 1 when a key was pressed, or 0 otherwise. This behavior is emulated by default, so a key release is generated immediately after every key press. To have full functionality, FLTK can be used to capture keyboard events. <link linkend="FLpanel"><citetitle>FLpanel</citetitle></link> can be used to capture keyboard events and send them to the sensekey opcode, by adding an additional optional argument. See <link linkend="FLpanel"><citetitle>FLpanel</citetitle></link> for more information.
38 </para>
39
40 <note>
41 <title>Note</title>
42 <para>
43 This opcode can also be written as <link linkend="sense"><citetitle>sense</citetitle></link>.
44 </para>
45 </note>
46 </refsect1>
47
48 <refsect1>
49 <title>Examples</title>
50 <para>
51 Here is an example of the sensekey opcode. It uses the file <ulink url="examples/sensekey.csd"><citetitle>sensekey.csd</citetitle></ulink>.
52
53 <example>
54 <title>Example of the sensekey opcode.</title>
55 <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>
56 <xi:include href="examples-xml/sensekey.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
57 </example>
58 </para>
59 </refsect1>
60
61 <refsect1>
62 <title>See also</title>
63 <para><link linkend="ControlSensing"><citetitle>Sensing and Control: Keyboard and mouse sensing</citetitle></link></para>
64 </refsect1>
65
66 <refsect1>
67 <title>Credits</title>
68 <para>
69 <simplelist>
70 <member>Author: &namejohn;</member>
71 <member>University of Bath, Codemist. Ltd.</member>
72 <member>Bath, UK</member>
73 <member>October 2000</member>
74 </simplelist>
75 </para>
76
77 <para>New in Csound version 4.09. Renamed in Csound version 4.10.</para>
78 </refsect1>
79 </refentry>