This fairly straightforward example intends to use a different mouse cursor when the mouse button is pressed than when it isn't, but it doesn't work.
Expected result: clicking and holding the mouse button changes the mouse cursor and moving the mouse while the button is pressed should show the NS/EW cursor, while when the mouse button is released the normal pointer should be shown.
Actual result: the cursor doesn't change until the mouse button is released, and then reverts to the pointer when the mouse is subsequently moved.
Code:
function update()
gfx.update()
if gfx.mouse_cap & 0x01 ~= 0 then
-- NS/EW move cursor
gfx.setcursor(32646)
else
-- Normal pointer
gfx.setcursor(32512)
end
reaper.defer(update)
end
gfx.init("Mouse cursor test", 800, 600)
update()