Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

takecontrole of left/right arrow keys

AndroGyne Qinan
Registered User
Join date: 8 Apr 2007
Posts: 8
08-28-2007 23:44
Hi folks,
This girl is using the llTakeControle in order to rotated a av sitting on a object.
There is an event generated when pressing the left or right arrow key, so this girl can write a function which rotates the object on which the AV is sitting, but the AV is also rotating on it's own as if this girl didn't takecontrole.
Is it possible that the AV don't respont to the left/right arrow-key, just like it don't respond to the up/down key, so the script can handle the generated event.

with regards
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
08-29-2007 03:44
Yes. If you look at http://rpgstats.com/wiki/index.php?title=LlTakeControls:

llTakeControls(integer controls, integer accept, integer pass_on)

use TRUE for accept and FALSE for pass_on, that way your script gets an event for the keys and the keys are moving your AV.
AndroGyne Qinan
Registered User
Join date: 8 Apr 2007
Posts: 8
08-29-2007 03:49
It works for all other keys, but probalbly not for the right /left arrow keys, There is a event triggerd, but the av is still moving.
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
08-29-2007 04:29
Hi Androgyne, perhaps the problem is that you've captured CONTROL_LEFT and CONTROL_RIGHT but not CONTROL_ROT_LEFT and CONTROL_ROT_RIGHT?

I tested this code and, as expected, was unable to rotate or move left and right:

default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
}

run_time_permissions(integer perm)
{
llTakeControls(CONTROL_ROT_LEFT | CONTROL_ROT_RIGHT | CONTROL_LEFT | CONTROL_RIGHT, TRUE, FALSE);
}
}
_____________________
AndroGyne Qinan
Registered User
Join date: 8 Apr 2007
Posts: 8
08-29-2007 23:55
Thanks all, it works, or beter it don't work *smiles*, i can't move/turn.

with regards
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
08-30-2007 01:35
From: AndroGyne Qinan
Thanks all, it works, or beter it don't work *smiles*, i can't move/turn.

with regards


If it doesn't work, can you post the relevent code here?

Both the section where you take controls, and the section where you handle the key presses.
AndroGyne Qinan
Registered User
Join date: 8 Apr 2007
Posts: 8
08-30-2007 01:49
Sorry for not being all clear. The script is working, this girl don't rotate when pressed an arrow key, but get a event, and that is what thsi girl asked for. This girl can write now a script which responds to the event.

thank You all who helped.