KeyDown.htm 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>KeyDown (scancode)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. scancode = corresponding key scancode
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This command (similar to its counterparts MouseDown and JoyDown) is used to detect if a key is being held down. This command returns a 0 if the key is not held down, a 1 if the key is held down. <br />
  21. <br />
  22. See Also: ScanCodes
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/KeyDown.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; KeyDown() example <br />
  31. <br />
  32. Print "Hold down ENTER key!" <br />
  33. Delay 3000 <br />
  34. While Not KeyHit(1) <br />
  35. If KeyDown(28) Then <br />
  36. Print "Enter is being pressed!" <br />
  37. Else <br />
  38. Print <br />
  39. End If <br />
  40. Wend
  41. </td>
  42. </tr>
  43. </table>
  44. <br>
  45. <a target=_top href=../index.htm>Index</a><br>
  46. <br>
  47. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=KeyDown&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  48. </html>