Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 02-16-2021, 01:59 PM   #1
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,539
Default API: gfx.setcursor() broken when mouse button pressed (FIXED)

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()
tack is offline   Reply With Quote
Old 02-18-2021, 07:47 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,118
Default

I can confirm it.
In this example, it's not possible to have a i.e. dragging-mouse-cursor while the mouse is clicked, only after mouse-click has been released.

So coding of moving objects around with a dragging-mousecursor displayed is not possible to do that way.

Windows 7, Reaper 6.23x64
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 02-18-2021, 08:48 PM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,223
Default

Fixing, thanks!
Justin is offline   Reply With Quote
Old 02-19-2021, 06:23 PM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,118
Default

Fixed in the latest 6.24-rc3-release.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 02-19-2021, 06:35 PM   #5
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,539
Default

Wow, if only all buglets got squashed this crazy-fast!

Thanks very much Justin, and Mespotine for reproducing and following up.
tack is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.