Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetClickAction() and its constants

Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
05-11-2009 15:23
While working on a script, I decided to try out llSetClickAction() to enable or disable the touch events based on other circumstances the script decides from. This is a multi-purpose script that sometimes needs a touch event and other times does not depending on configurations.

I noticed in the lsl wiki that CLICK_ACTION_TOUCH and CLICK_ACTION_NONE are both equal to 0. Why is that? Shouldn't CLICK_ACTION_NONE disable the touch_event?

Just for an experiment, instead of using llSetClickAction(CLICK_ACTION_NONE) I used llSetClickAction(-1) and got the results I needed:

With a two prim object, the root prim has llSetClickAction(CLICK_ACTION_TOUCH) and the child prim has llSetClickAction(-1), the cursor will change to the hand-pointer when over the root prim and the standard arrow when over the child prim. But, vice-versa, the cursor always is the arrow but functionality still works.

Setting llSetClickAction(-1) is not documented and does not produce a runtime error, just wondering if anybody has some insight on this function.
_____________________
+/- 0.00004
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
05-11-2009 15:31
CLICK_ACTION_NONE and CLICK_ACTION_TOUCH are also both defined as 0 in client code. Further, the click actions are officially defined as unsigned integers, and use U8 data type throughout.

llSetClickAction(-1) is setting the click action to 255, and since that click action isn't defined the default is just to do nothing special
_____________________
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
05-11-2009 17:02
From: Day Oh
llSetClickAction(-1) is setting the click action to 255, and since that click action isn't defined the default is just to do nothing special


That is kind of what I am seeing - the touch event still occurs when using 255 or -1, but if I set it to 255 or -1 in the root prim and 0 in the child prim, the cursor does not change to the hand pointer when moved over the child prim like it normally should, which obscures the indication that the child prim has a touch event. The cursor remains an arrow when over the root prim but still handles the touch event.

This is a multi-purpose script, sometimes a touch event is needed and sometimes it is not, depending on the configuration. In this application, I would rather not have the hand pointer at all, so I guess the next question - is this safe to do? Is there a Jira that already requests a 'do nothing and disable touch events' parameter with the llSetClickAction() function? That's what I really want is a way to enable/disable the touch event without changing states.
_____________________
+/- 0.00004
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-11-2009 18:20
Using non-existent values may or may not be supported in future versions. Clever idea though... needs a Jira.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
05-11-2009 23:59
but the question if, does it actually disable it, and the likely answer is no, it just disables the pointer (I know the pie menu will definitely still work)

the only way to completely disable an event type is to be in a state that doesn't have the event handler (though you can set a sentinel value that evaluates to true or false to cause it skip code in that event)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -