In doing this I have run a couple experiments, and removed the llSleep kluge.
I'm posting this thread as one tiny clue for folks making the transition from SL to Kitely.
For the experiment I used the following event handler in my script.
Code: Select all
control( key id, integer levels, integer edge ) {
integer start = level & edge;
integer end = ~level & edge;
integer held = level & ~edge;
integer untouched = ~(level | edge);
llOwnerSay(llList2CSV([level, edge, start, end, held, untouched]));
}
Output from Kitely:
[15:04] Box Plane: 16, 16, 16, 0, 0, -17
[15:04] Box Plane: 0, 16, 0, 16, 0, -17
[15:04] Box Plane: 32, 32, 32, 0, 0, -33
[15:04] Box Plane: 0, 32, 0, 32, 0, -33
Output from SL:
[15:03] Box Plane: 16, 16, 16, 0, 0, -17
[15:03] Box Plane: 16, 0, 0, 0, 16, -17
[15:03] Box Plane: 16, 0, 0, 0, 16, -17
[15:03] Box Plane: 16, 0, 0, 0, 16, -17
[15:03] Box Plane: 16, 0, 0, 0, 16, -17
[15:03] Box Plane: 0, 16, 0, 16, 0, -17
[15:03] Box Plane: 32, 32, 32, 0, 0, -33
[15:03] Box Plane: 32, 0, 0, 0, 32, -33
[15:03] Box Plane: 32, 0, 0, 0, 32, -33
[15:03] Box Plane: 32, 0, 0, 0, 32, -33
[15:03] Box Plane: 32, 0, 0, 0, 32, -33
[15:03] Box Plane: 0, 32, 0, 32, 0, -33
You will notice that SL sends the "key held" messages.
At first I thought, well maybe Kitely is just slow in its cycles so my quick release was beating the held event.
So I held the button down for a minute or more.
Still no "held key" signal in Kitely.
I wasn't planning on using the "key held" in my programs. Maybe there is a special flag that can be set?
I don't know if this is client side, or server side.
Just an FYI.
The real reason I bother you with this post is: llSleep( 0.15 );
There are a bunch of scripts (of the free script variety) bouncing around that stick a llSleep in the control event.
This was probably used to avoid processing the held and end events.
I find the following code a bit cleaner for me -- i.e. no kluge llSleep.
Code: Select all
control(key id, integer level, integer edge)
{
if (level & edge) {
// drop through to control handlers
} else {
// is either held or end
return;
}
integer throttle_up = CONTROL_UP;
integer throttle_down = CONTROL_DOWN;
if ((level & throttle_up)) {
throttle++;
if (throttle > maxThrottle) {
throttle = maxThrottle;
}
} else if (level & throttle_down) {
throttle--;
if (throttle < 0) {
throttle = 0;
}
}
etc.
etc.
}
Please clue me in if you happen to know of such a good reason.