vibrate.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. return {
  2. tag = 'input',
  3. summary = 'Make a device go BZZZ!',
  4. description = [[
  5. Causes the device to vibrate with a custom strength, duration, and frequency, if possible.
  6. ]],
  7. arguments = {
  8. device = {
  9. type = 'Device',
  10. default = [['head']],
  11. description = 'The device to vibrate.'
  12. },
  13. strength = {
  14. type = 'number',
  15. default = '1',
  16. description = 'The strength of the vibration (amplitude), between 0 and 1.'
  17. },
  18. duration = {
  19. type = 'number',
  20. default = '.5',
  21. description = 'The duration of the vibration, in seconds.'
  22. },
  23. frequency = {
  24. type = 'number',
  25. default = '0',
  26. description = 'The frequency of the vibration, in hertz. 0 will use a default frequency.'
  27. }
  28. },
  29. returns = {
  30. vibrated = {
  31. type = 'boolean',
  32. description = 'Whether the vibration was successfully triggered by an active headset driver.'
  33. }
  34. },
  35. variants = {
  36. {
  37. arguments = { 'device', 'strength', 'duration', 'frequency' },
  38. returns = { 'vibrated' }
  39. }
  40. },
  41. related = {
  42. 'lovr.headset.stopVibration'
  43. }
  44. }