wasReleased.lua 995 B

12345678910111213141516171819202122232425262728293031323334353637
  1. return {
  2. tag = 'input',
  3. summary = 'Check if a button was just released.',
  4. description = 'Returns whether a button on a device was released this frame.',
  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 to check.'
  15. }
  16. },
  17. returns = {
  18. {
  19. name = 'released',
  20. type = 'boolean',
  21. description = 'Whether the button on the device was released this frame.'
  22. }
  23. },
  24. notes = [[
  25. Some headset backends are not able to return pressed/released information. These drivers will
  26. always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.
  27. Typically the internal `lovr.headset.update` function will update pressed/released status.
  28. ]],
  29. related = {
  30. 'DeviceButton',
  31. 'lovr.headset.isDown',
  32. 'lovr.headset.wasPressed',
  33. 'lovr.headset.isTouched',
  34. 'lovr.headset.getAxis'
  35. }
  36. }