Difference between revisions of "Control"

From Second Life Wiki
Jump to navigation Jump to search
(removed my name from front (names should go on discussion page) and included issue number for current abnormal behavior.)
m (added brief explanation of what "level" and "edge" mean)
Line 54: Line 54:
If [[llMinEventDelay]] is set to at least double this events delay, then this event will treat the [[llMinEventDelay]] as if it were half; in other words, this event can trigger twice as often as other events if the [[llMinEventDelay]] is greater than 0.1
If [[llMinEventDelay]] is set to at least double this events delay, then this event will treat the [[llMinEventDelay]] as if it were half; in other words, this event can trigger twice as often as other events if the [[llMinEventDelay]] is greater than 0.1


My tests determined that the key returned when an agent control is caught is not the key for that agent, but is the object owner's key. If more then one script is used in the same object to hold permissions for multiple agents simultaneously, control may be triggered in all scripts but there is no way to know which agent actually caused the trigger. This has been filed as [http://jira.secondlife.com/browse/SVC-476 SVC-476]  
My tests determined that the key returned when an agent control is caught is not the key for that agent, but is the object owner's key. If more then one script is used in the same object to hold permissions for multiple agents simultaneously, control may be triggered in all scripts but there is no way to know which agent actually caused the trigger. This has been filed as [http://jira.secondlife.com/browse/SVC-476 SVC-476]
 
"level" is non-zero when the key is being held down constantly.
 
"edge" is non-zero in the instant that the key state is changing, i.e. during key-down or key-up.


|mode
|mode

Revision as of 12:18, 20 May 2008

Description

Event: control( key id, integer level, integer edge ){ ; }
15 Event ID
0.05 Delay

Result of llTakeControls library function call and user input.

• key id
• integer level
• integer edge
Constant Value Description
CONTROL_FWD 0x00000001 Move forward control ( or W)
CONTROL_BACK 0x00000002 Move back control ( or S)
CONTROL_LEFT 0x00000004 Move left control (⇧ Shift- or ⇧ Shift-A [ or A in mouselook])
CONTROL_RIGHT 0x00000008 Move right control (⇧ Shift- or ⇧ Shift-D [ or D in mouselook])
CONTROL_ROT_LEFT 0x00000100 Rotate left control ( or A)
CONTROL_ROT_RIGHT 0x00000200 Rotate right control ( or D)
CONTROL_UP 0x00000010 Move up control (PgUp or E)
CONTROL_DOWN 0x00000020 Move down control (PgDn or C)
CONTROL_LBUTTON 0x10000000 Left mouse button control
CONTROL_ML_LBUTTON 0x40000000 Left mouse button control while in mouselook
(undocumented) 0x02000000 Avatar left rotation detected. Triggers llGetAnimation == "Turning Left"
(undocumented) 0x04000000 Avatar right rotation detected. Triggers llGetAnimation == "Turning Right"

Caveats


Examples

<lsl>default {

   state_entry()
   {
       llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
   }
   run_time_permissions(integer perm)
   {
       if(PERMISSION_TAKE_CONTROLS & perm)
       {
           llTakeControls(
                           CONTROL_FWD

Notes

llGetRot in mouselook for an attachment returns the angle the avatar is looking in.

If llMinEventDelay is set to at least double this events delay, then this event will treat the llMinEventDelay as if it were half; in other words, this event can trigger twice as often as other events if the llMinEventDelay is greater than 0.1

My tests determined that the key returned when an agent control is caught is not the key for that agent, but is the object owner's key. If more then one script is used in the same object to hold permissions for multiple agents simultaneously, control may be triggered in all scripts but there is no way to know which agent actually caused the trigger. This has been filed as SVC-476

"level" is non-zero when the key is being held down constantly.

"edge" is non-zero in the instant that the key state is changing, i.e. during key-down or key-up.

See Also

Deep Notes

Signature

event void control( key id, integer level, integer edge );