isMouseDown.lua 833 B

123456789101112131415161718192021222324252627282930313233
  1. return {
  2. tag = 'system-mouse',
  3. summary = 'Check if a mouse button is pressed.',
  4. description = 'Returns whether a mouse button is currently pressed.',
  5. arguments = {
  6. button = {
  7. type = 'number',
  8. description = [[
  9. The index of a button to check. Use 1 for the primary mouse button, 2 for the secondary
  10. button, and 3 for the middle button. Other indices can be used, but are hardware-specific.
  11. ]]
  12. }
  13. },
  14. returns = {
  15. down = {
  16. type = 'boolean',
  17. description = 'Whether the mouse button is currently down.'
  18. }
  19. },
  20. variants = {
  21. {
  22. arguments = { 'button' },
  23. returns = { 'down' }
  24. }
  25. },
  26. related = {
  27. 'lovr.mousepressed',
  28. 'lovr.mousereleased',
  29. 'lovr.system.getMouseX',
  30. 'lovr.system.getMouseY',
  31. 'lovr.system.getMousePosition'
  32. }
  33. }