isTouched.lua 788 B

1234567891011121314151617181920212223242526272829303132333435
  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. device = {
  7. type = 'Device',
  8. description = 'The device.'
  9. },
  10. button = {
  11. type = 'DeviceButton',
  12. description = 'The button.'
  13. }
  14. },
  15. returns = {
  16. touched = {
  17. type = 'boolean',
  18. description = [[
  19. Whether the button on the device is currently touched, or `nil` if the device does not have
  20. the button or it isn't touch-sensitive.
  21. ]]
  22. }
  23. },
  24. variants = {
  25. {
  26. arguments = { 'device', 'button' },
  27. returns = { 'touched' }
  28. }
  29. },
  30. related = {
  31. 'DeviceButton',
  32. 'lovr.headset.isDown',
  33. 'lovr.headset.getAxis'
  34. }
  35. }