Difference between revisions of "Control"

From Second Life Wiki
Jump to navigation Jump to search
Line 11: Line 11:
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_FWD}}
{{!}} {{LSLG|CONTROL_FWD}}
{{!}} {{LSL Hex|0x00000001}}
{{!}} Move forward control.
{{!}} Move forward control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_BACK}}
{{!}} {{LSLG|CONTROL_BACK}}
{{!}} {{LSL Hex|0x00000002}}
{{!}} Move back control.
{{!}} Move back control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_LEFT}}
{{!}} {{LSLG|CONTROL_LEFT}}
{{!}} {{LSL Hex|0x00000004}}
{{!}} Move left control.
{{!}} Move left control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_RIGHT}}
{{!}} {{LSLG|CONTROL_RIGHT}}
{{!}} {{LSL Hex|0x00000008}}
{{!}} Move right control.
{{!}} Move right control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_ROT_LEFT}}
{{!}} {{LSLG|CONTROL_ROT_LEFT}}
{{!}} {{LSL Hex|0x00000100}}
{{!}} Rotate left control.
{{!}} Rotate left control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_ROT_RIGHT}}
{{!}} {{LSLG|CONTROL_ROT_RIGHT}}
{{!}} {{LSL Hex|0x00000200}}
{{!}} Rotate right control.
{{!}} Rotate right control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_UP}}
{{!}} {{LSLG|CONTROL_UP}}
{{!}} {{LSL Hex|0x00000010}}
{{!}} Move up control.
{{!}} Move up control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_DOWN}}
{{!}} {{LSLG|CONTROL_DOWN}}
{{!}} {{LSL Hex|0x00000020}}
{{!}} Move down control.
{{!}} Move down control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_LBUTTON}}
{{!}} {{LSLG|CONTROL_LBUTTON}}
{{!}} {{LSL Hex|0x10000000}}
{{!}} Left mouse button control.
{{!}} Left mouse button control.
{{!}}-
{{!}}-
{{!}} {{LSLG|CONTROL_ML_LBUTTON}}
{{!}} {{LSLG|CONTROL_ML_LBUTTON}}
{{!}} {{LSL Hex|0x40000000}}
{{!}} Left mouse button control while in {{LSLG|mouselook}}.
{{!}} Left mouse button control while in {{LSLG|mouselook}}.
{{!}}}
{{!}}}
Line 79: Line 89:
|helpers
|helpers
|also_header
|also_header
|also_events
|also_events=*{{LSLG|run_time_permissions}}
|also_functions
|also_functions=*{{LSLG|llTakeControls}}
*{{LSLG|llRequestPermissions}}
|also_tests
|also_tests
|also_articles
|also_articles
|also_footer
|also_footer
|notes
|notes=llGetRot in mouselook for an attachment returns the angle the avatar is looking in.
|mode
|mode
|deprecated
|deprecated
|cat1
|cat1=Control
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 02:20, 14 February 2007

Description

Event: control( key id, integer level, integer edge ){ ; }

Result of llTakeControls library function call and user input.

• key id
• integer level
• integer edge
Constant Value Description
CONTROL_FWD 0x00000001 Move forward control.
CONTROL_BACK 0x00000002 Move back control.
CONTROL_LEFT 0x00000004 Move left control.
CONTROL_RIGHT 0x00000008 Move right control.
CONTROL_ROT_LEFT 0x00000100 Rotate left control.
CONTROL_ROT_RIGHT 0x00000200 Rotate right control.
CONTROL_UP 0x00000010 Move up control.
CONTROL_DOWN 0x00000020 Move down control.
CONTROL_LBUTTON 0x10000000 Left mouse button control.
CONTROL_ML_LBUTTON 0x40000000 Left mouse button control while in mouselook.

Examples

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
    }
    run_time_permissions(integer perm)
    {
        if(PERMISSION_TAKE_CONTROLS & perm)
        {
            llTakeControls(
                            CONTROL_FWD |
                            CONTROL_BACK |
                            CONTROL_LEFT |
                            CONTROL_RIGHT |
                            CONTROL_ROT_LEFT |
                            CONTROL_ROT_RIGHT |
                            CONTROL_UP |
                            CONTROL_DOWN |
                            CONTROL_LBUTTON |
                            CONTROL_ML_LBUTTON |
                            0, TRUE, TRUE);
        }
    }
    control(key id, integer level, integer edge)
    {
        integer start = level & edge;
        integer end = ~level & edge;
        integer held = level & ~edge;
        integer unheld = ~(level & edge);
        llOwnerSay(llList2CSV([level, edge, start, end, held, unheld]));
    }
}

Notes

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

Deep Notes

Signature

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