isDown.lua 758 B

12345678910111213141516171819202122232425262728293031323334
  1. return {
  2. tag = 'input',
  3. summary = 'Get the state of a button on a device.',
  4. description = 'Returns whether a button on a device is pressed.',
  5. arguments = {
  6. {
  7. name = 'device',
  8. type = 'Device',
  9. description = 'The device.'
  10. },
  11. {
  12. name = 'button',
  13. type = 'DeviceButton',
  14. description = 'The button.'
  15. }
  16. },
  17. returns = {
  18. {
  19. name = 'down',
  20. type = 'boolean',
  21. description = [[
  22. Whether the button on the device is currently pressed, or `nil` if the device does not have
  23. the specified button.
  24. ]]
  25. }
  26. },
  27. related = {
  28. 'DeviceButton',
  29. 'lovr.headset.wasPressed',
  30. 'lovr.headset.wasReleased',
  31. 'lovr.headset.isTouched',
  32. 'lovr.headset.getAxis'
  33. }
  34. }