Collection of custom reaper scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

  1. -- Basic gui stuff by forum user "spk77": https://forum.cockos.com/showthread.php?t=161557
  2. -----------------
  3. -- Mouse table --
  4. -----------------
  5. local mouse = {
  6. -- Constants
  7. LB = 1,
  8. RB = 2,
  9. CTRL = 4,
  10. SHIFT = 8,
  11. ALT = 16,
  12. -- "cap" function
  13. cap = function (mask)
  14. if mask == nil then
  15. return gfx.mouse_cap end
  16. return gfx.mouse_cap&mask == mask
  17. end,
  18. uptime = 0,
  19. last_x = -1, last_y = -1,
  20. dx = 0,
  21. dy = 0,
  22. ox_l = 0, oy_l = 0, -- left click positions
  23. ox_r = 0, oy_r = 0, -- right click positions
  24. capcnt = 0,
  25. last_LMB_state = false,
  26. last_RMB_state = false
  27. }
  28. return mouse