joystick.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <html>
  2. <head>
  3. <title>Joystick</title>
  4. </head>
  5. <body bgcolor="FFFFFF">
  6. <h1><img align="center" src="../../../../en/icons/joystick.gif" width="32" height="32">
  7. <em>Joystick</em></h1>
  8. <p><table>
  9. <tr><td><strong>Library:</strong></td>
  10. <td><a href="index.html">Input/Output</a></td></tr>
  11. <tr><td><strong>Introduced:</strong></td>
  12. <td>2.2.0</td></tr>
  13. <tr><td valign="top"><strong>Appearance:</strong></td>
  14. <td valign="top"><img src="../../../../en/img-libs/joystick.png" width="33" height="31"></td></tr>
  15. </table></p>
  16. <h2>Behavior</h2>
  17. <p>The user can drag the red knob within the rounded-square area, and the outputs
  18. update to indicate the knob's current <var>x</var>- and
  19. <var>y</var>-coordinates. This is meant to emulate the joysticks known from
  20. the days of classical arcade games.</p>
  21. <h2>Pins</h2>
  22. <dl>
  23. <dt>West edge, north pin (output, bit width matches Bit Width attribute)</dt>
  24. <dd>Indicates knob's <var>x</var>-coordinate, to be interpreted as an unsigned
  25. integer whose value will never be 0. Thus, a value of 1 represents the far left,
  26. and the maximum value for the bit width indicates the far right. When the knob
  27. is at rest (in the center), the value has the bit pattern 10...00.</dd>
  28. <dt>West edge, south pin (output, bit width matches Bit Width attribute)</dt>
  29. <dd>Indicates knob's <var>y</var>-coordinate, whose value ranges as with the
  30. <var>x</var>-coordinate pin. When the knob is pulled to the top, this output's
  31. value is 1, and when the knob is pulled to the bottom, the output is the
  32. maximum value for the bit width selected.</dd>
  33. </dl>
  34. <h2>Attributes</h2>
  35. <p>When the component is selected or being added,
  36. Alt-2 through Alt-5 alter its <q>Bit Width</q> attribute.</p>
  37. <dl>
  38. <dt>Bit Width</dt>
  39. <dd>The number of bits used to indicate each of the knob's coordinates.</dd>
  40. <dt>Color</dt>
  41. <dd>The knob's color as it is drawn on the screen.</dd>
  42. </dl>
  43. <h2>Poke Tool Behavior</h2>
  44. <p>Pressing the mouse button while within the joystick area moves the knob to
  45. that location and updates the outputs. Dragging the mouse continues to move
  46. the knob and update the outputs, keeping the knob within the joystick's area.
  47. Releasing the mouse button reverts the knob back to its rest position.</p>
  48. <h2>Text Tool Behavior</h2>
  49. <p>None.</p>
  50. <p><a href="../index.html">Back to <em>Library Reference</em></a></p>
  51. </body>
  52. </html>