Jump to content

Controls for left mouse "press" and "release" are no longer working in mouselook.


Minx Bade
 Share

You are about to reply to a thread that has been inactive for 845 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Since the update server code the controls for the left mouse button no longer have the parameter for "press" and "release". The function works in third person but fails in mouselook. Here is a quick script I made to demonstrate this issue.

 

default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }
    state_entry()
    {
        llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS);
    }
    run_time_permissions(integer permissions)
    {
        llTakeControls(CONTROL_ML_LBUTTON | CONTROL_LBUTTON | CONTROL_UP , TRUE, TRUE);
    }
    control(key id,integer held,integer change)
    {
        if(change & held & CONTROL_LBUTTON || change & held & CONTROL_ML_LBUTTON)
        {
            llSay(0,"depressed");
            llOwnerSay((string)change + " and " + (string)held);
        }
        if(change & ~held & CONTROL_LBUTTON || change & ~held & CONTROL_ML_LBUTTON)
        {
            llSay(0,"released");
            llOwnerSay((string)change + " and " + (string)held);
        }
    }
}

Link to comment
Share on other sites

When I test your script in a HUD I get the following result in third-person:

depressed
[14:27] TEST: 268435456 and 268435456
[14:27] TEST: released
[14:27] TEST: 268435456 and 0

and this result in mouselook:

depressed
[14:28] TEST: 1342177280 and 1342177280
[14:28] TEST: released
[14:28] TEST: 268435456 and 1073741824
[14:28] TEST: released
[14:28] TEST: 1073741824 and 0

So, in fact, the script is detecting both "press" and "release" in both modes. In mouselook, though, you are getting two signals on release, both of which will be accepted as valid.  I'm at a momentary loss to explain why you get that second bounce, but I'm sure someone else will know.

  • Like 1
Link to comment
Share on other sites

Seems like the double-event bug is already reported on the Jira: https://jira.secondlife.com/browse/BUG-231069

Quote

Maestro Linden:

For what it's worth, I see the expected behavior in the Second Life 5.0.9.329906 linux viewer: when pressing LMB in mouselook mode, the script only registers CONTROL_ML_LBUTTON press and release events, as one would expect. I suspect this bug was introduced to the official viewer at some point, and was also merged into Firestorm.

Update: we confirmed that the https://releasenotes.secondlife.com/viewer/6.4.17.557391.html release is responsible for this bug.

So the viewer is what's broken, not the server.

Edited by Wulfie Reanimator
  • Thanks 3
Link to comment
Share on other sites

8 minutes ago, Wulfie Reanimator said:

So the viewer is what's broken, not the server.

But it seems from my brief test that the double event will probably not give you a bad result, since both "release" results are consistent with change & ~held & CONTROL_LBUTTON || change & ~held & CONTROL_ML_LBUTTON.  It looks to me as if both conditions are evaluating to TRUE, hence the double hit.  All you really care about is whether either of them does. 

Link to comment
Share on other sites

14 minutes ago, Rolig Loon said:

But it seems from my brief test that the double event will probably not give you a bad result, since both "release" results are consistent with change & ~held & CONTROL_LBUTTON || change & ~held & CONTROL_ML_LBUTTON.  It looks to me as if both conditions are evaluating to TRUE, hence the double hit.  All you really care about is whether either of them does. 

I isolated the original script's functionality a little bit, and this is my output:

Wulfie Reanimator: mouselook press
Object: event, change:1342177280 and held:1342177280
Object: press LBUTTON
Object: press ML_LBUTTON
Object: event, change:268435456 and held:1073741824
Object: release LBUTTON
Wulfie Reanimator: mouselook release
Object: event, change:1073741824 and held:0
Object: release ML_LBUTTON

To clarify, when I press ML_LBUTTON, two separate events match the conditions of the script;

  • The first event detects that ML_LBUTTON and LBUTTON are being pressed, which is a bug.
  • The second event detects that LBUTTON is released, but in this moment I'm still holding the button down.
    • The script is retroactively being notified that LBUTTON is not being pressed, which is true because it wasn't ever supposed to be pressed in the first event.

When I later release ML_LBUTTON, its release is detected correctly.

My script (formatted so it's not 100000 lines long, apologies):

default
{
    on_rez(integer start_param)                     {llResetScript();}
    state_entry()                                   {llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);}
    run_time_permissions(integer permissions)       {llTakeControls(CONTROL_ML_LBUTTON | CONTROL_LBUTTON, TRUE, TRUE);}

    control(key id,integer held,integer change)
    {
        if (!change) return;

        llOwnerSay((string)["event, change:",change," and held:",held]);

        if (change & held & CONTROL_LBUTTON)        {llOwnerSay("press LBUTTON");}
        if (change & held & CONTROL_ML_LBUTTON)     {llOwnerSay("press ML_LBUTTON");}

        if (change & ~held & CONTROL_LBUTTON)       {llOwnerSay("release LBUTTON");}
        if (change & ~held & CONTROL_ML_LBUTTON)    {llOwnerSay("release ML_LBUTTON");}
    }
}

 

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 845 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...