Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

when a control is not a control

Tuhfah Jecies
Registered User
Join date: 1 Jun 2008
Posts: 16
06-23-2008 01:45
OK we use this to take control:

llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE);

To capture the controls with usesomething like this for the various combinations and apply an associated event etc.:

if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT))

Now is there anyway to clock when NO controlls are being changed or held?
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
06-23-2008 01:54
From: Tuhfah Jecies
Now is there anyway to clock when NO controlls are being changed or held?

You will get something in edge but a zero level when everything has been released. You could stash that away in a variable and use it in a timer or whatever, if you need some kind of "idle" action. You'll probably want to set that variable to nothing held on attach etc., until a control event tells you otherwise.
_____________________
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-23-2008 02:12
you can test for key pressed, held and released:
CODE
control(key id, integer down, integer new)
{
integer pressed = down & new;
integer held = down & ~new;
integer released = ~down & new;
...

so you can detect when all keys are released! what more can you ask?
You can not test for no keys held, because that will not trigger an event.
see: http://www.lslwiki.net/lslwiki/wakka.php?wakka=control
_____________________
From Studio Dora
Tuhfah Jecies
Registered User
Join date: 1 Jun 2008
Posts: 16
06-23-2008 03:29
thanks people
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
06-23-2008 08:43
if you didnt know ~ in lsl means no or not hold, i use it for sound related stuff in some of my weapons