isTouched.lua 726 B

1234567891011121314151617181920212223242526272829303132
  1. return {
  2. tag = 'input',
  3. summary = 'Check if a button on a device is touched.',
  4. description = 'Returns whether a button on a device is currently touched.',
  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 = 'touched',
  20. type = 'boolean',
  21. description = [[
  22. Whether the button on the device is currently touched, or `nil` if the device does not have
  23. the button or it isn't touch-sensitive.
  24. ]]
  25. }
  26. },
  27. related = {
  28. 'DeviceButton',
  29. 'lovr.headset.isDown',
  30. 'lovr.headset.getAxis'
  31. }
  32. }