Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Key</title>
  6. <base target="class-frame">
  7. <link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
  8. <script src="../assets/js/paper.js"></script>
  9. <script src="../assets/js/jquery.js"></script>
  10. <script src="../assets/js/codemirror.js"></script>
  11. <script src="../assets/js/docs.js"></script>
  12. </head>
  13. <body>
  14. <article class="reference">
  15. <div class="reference-class">
  16. <h1>Key</h1>
  17. </div>
  18. <div class="reference-members">
  19. <h2>Static Properties</h2>
  20. <div id="modifiers" class="member">
  21. <div class="member-link">
  22. <a name="modifiers" href="#modifiers"><tt><b>Key.modifiers</b></tt></a>
  23. </div>
  24. <div class="member-description hidden">
  25. <div class="member-text">
  26. <p>The current state of the keyboard modifiers.</p>
  27. <ul class="member-list">
  28. <h4>Type:</h4>
  29. <li>
  30. <tt>Object</tt>
  31. </li>
  32. </ul>
  33. <ul class="member-list">
  34. <h4>Options:</h4>
  35. <li><tt>modifiers.shift: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the shift key is pressed, <tt>false</tt> otherwise.</li>
  36. <li><tt>modifiers.control: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the control key is pressed, <tt>false</tt> otherwise.</li>
  37. <li><tt>modifiers.alt: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the alt/option key is pressed, <tt>false</tt> otherwise.</li>
  38. <li><tt>modifiers.meta: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the meta/windows/command key is pressed, <tt>false</tt> otherwise.</li>
  39. <li><tt>modifiers.capsLock: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the caps-lock key is active, <tt>false</tt> otherwise.</li>
  40. <li><tt>modifiers.space: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the space key is pressed, <tt>false</tt> otherwise.</li>
  41. <li><tt>modifiers.option: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the alt/option key is pressed, <tt>false</tt> otherwise. This is the same as <code>modifiers.alt</code></li>
  42. <li><tt>modifiers.command: <tt>Boolean</tt></tt> &mdash; <tt>true</tt> if the meta key is pressed on Mac, or the control key is pressed on Windows and Linux, <tt>false</tt> otherwise.</li>
  43. </ul>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="reference-members">
  49. <h2>Static Methods</h2>
  50. <div id="isdown-key" class="member">
  51. <div class="member-link">
  52. <a name="isdown-key" href="#isdown-key"><tt><b>Key.isDown</b>(key)</tt></a>
  53. </div>
  54. <div class="member-description hidden">
  55. <div class="member-text">
  56. <p>Checks whether the specified key is pressed.</p>
  57. <ul class="member-list">
  58. <h4>Parameters:</h4>
  59. <li>
  60. <tt>key:</tt>
  61. <tt>String</tt>
  62. &mdash;&nbsp;any character or special key descriptor: <tt>&lsquo;enter&rsquo;</tt>, <tt>&lsquo;space&rsquo;</tt>, <tt>&lsquo;shift&rsquo;</tt>, <tt>&lsquo;control&rsquo;</tt>, <tt>&lsquo;alt&rsquo;</tt>, <tt>&lsquo;meta&rsquo;</tt>, <tt>&lsquo;caps-lock&rsquo;</tt>, <tt>&lsquo;left&rsquo;</tt>, <tt>&lsquo;up&rsquo;</tt>, <tt>&lsquo;right&rsquo;</tt>, <tt>&lsquo;down&rsquo;</tt>, <tt>&lsquo;escape&rsquo;</tt>, <tt>&lsquo;delete&rsquo;</tt>, &hellip;
  63. </li>
  64. </ul>
  65. <ul class="member-list">
  66. <h4>Returns:</h4>
  67. <li>
  68. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the key is pressed, <tt>false</tt> otherwise
  69. </li>
  70. </ul>
  71. <h4>Example:<span class="description">Whenever the user clicks, create a circle shaped path. If the 'a' key is pressed, fill it with red, otherwise fill it with blue:</span></h4>
  72. <pre><code>function onMouseDown(event) {
  73. var path = new Path.Circle(event.point, 10);
  74. if (Key.isDown('a')) {
  75. path.fillColor = 'red';
  76. } else {
  77. path.fillColor = 'blue';
  78. }
  79. }</code></pre>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <!-- =========================== copyright notice ========================== -->
  85. <p class="footer">
  86. Paper.js v0.12.15<br>
  87. Copyright &#169; 2011—2021 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
  88. <div class="content-end"></div>
  89. </article>
  90. </body>