wasPressed.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. return {
  2. tag = 'input',
  3. summary = 'Check if a button was just pressed.',
  4. description = 'Returns whether a button on a device was pressed this frame.',
  5. arguments = {
  6. device = {
  7. type = 'Device',
  8. description = 'The device.'
  9. },
  10. button = {
  11. type = 'DeviceButton',
  12. description = 'The button to check.'
  13. }
  14. },
  15. returns = {
  16. pressed = {
  17. type = 'boolean',
  18. description = 'Whether the button on the device was pressed this frame.'
  19. }
  20. },
  21. variants = {
  22. {
  23. arguments = { 'device', 'button' },
  24. returns = { 'pressed' }
  25. }
  26. },
  27. notes = [[
  28. Some headset backends are not able to return pressed/released information. These drivers will
  29. always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.
  30. Typically the internal `lovr.headset.update` function will update pressed/released status.
  31. ]],
  32. related = {
  33. 'DeviceButton',
  34. 'lovr.headset.isDown',
  35. 'lovr.headset.wasReleased',
  36. 'lovr.headset.isTouched',
  37. 'lovr.headset.getAxis'
  38. }
  39. }