Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Control_lbutton

JackInThe Schnook
Simboarding! ^_^
Join date: 31 Dec 2005
Posts: 46
08-05-2007 18:46
Why does this code not work in control events?
Other key work fine with same setup.
I need mouse click detection while outside mouselook. Not in.

From: someone
if(level & CONTROL_LBUTTON)
{
if ((level & CONTROL_LBUTTON) && (edge & CONTROL_LBUTTON))
{
llOwnerSay("Mouse Pressed";);

}
else if (!(level & CONTROL_LBUTTON) && (edge & CONTROL_LBUTTON))
{
llOwnerSay("Mouse Released";);
}
}
JackInThe Schnook
Simboarding! ^_^
Join date: 31 Dec 2005
Posts: 46
08-05-2007 18:50
nvm
only works with attachment not things you ride on?
Alicia Mounier
Registered User
Join date: 17 Oct 2005
Posts: 78
08-05-2007 18:51
lol, i dunno maybe the first part is messing it up?

From: someone
if(level & CONTROL_LBUTTON)////this part is needed?
{
if ((level & CONTROL_LBUTTON) && (edge & CONTROL_LBUTTON))
{
llOwnerSay("Mouse Pressed";);

}
else if (!(level & CONTROL_LBUTTON) && (edge & CONTROL_LBUTTON))
{
llOwnerSay("Mouse Released";);
}
}
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
08-05-2007 18:52
Sounds like you didn't ask for permission to take the controls.

http://wiki.secondlife.com/wiki/PERMISSION_TAKE_CONTROLS
JackInThe Schnook
Simboarding! ^_^
Join date: 31 Dec 2005
Posts: 46
08-05-2007 18:52
From: Alicia Mounier
lol, i dunno maybe the first part is messing it up?

yes otherwise it repeats with the message
I need to only get one message on the mouse status
JackInThe Schnook
Simboarding! ^_^
Join date: 31 Dec 2005
Posts: 46
08-05-2007 18:53
From: Jillian Callahan
Sounds like you didn't ask for permission to take the controls.

http://wiki.secondlife.com/wiki/PERMISSION_TAKE_CONTROLS

yes it works for other keys
this is a small part of a large code with control perm
I can use this with arrow keys or wsad and works fine
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
08-05-2007 19:01
From: JackInThe Schnook
yes it works for other keys
this is a small part of a large code with control perm
I can use this with arrow keys or wsad and works fine
Well, this got me both mouse-down and mouse up on a seat:

From: someone
control(key id, integer level, integer edge)
{
if ((level & CONTROL_LBUTTON) && (edge & CONTROL_LBUTTON))
{
llOwnerSay("Mouse Pressed";);
}
else if (!(level & CONTROL_LBUTTON) && (edge & CONTROL_LBUTTON))
{
llOwnerSay("Mouse Released";);
}
}
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
08-05-2007 19:02
From: JackInThe Schnook
Why does this code not work in control events?
Other key work fine with same setup.
I need mouse click detection while outside mouselook. Not in.


logic looks back asswards to me, try:

if(edge & CONTROL_LBUTTON)////this part is needed?
{
if (level & CONTROL_LBUTTON)
{
llOwnerSay("Mouse Pressed";);

}
else
{
llOwnerSay("Mouse Released";);
}
}
Alicia Mounier
Registered User
Join date: 17 Oct 2005
Posts: 78
08-05-2007 19:15
Yeah I think Jillian fixed it. Controls can be wonky sometimes but after a bit of tests and seeing how each combo works you'll understand.
JackInThe Schnook
Simboarding! ^_^
Join date: 31 Dec 2005
Posts: 46
08-05-2007 19:21
yes my logic is weird haha
Still nothing yet though and I tried the ones you guys posted and have nothing happening still.

But if I change to using CONTROL_BACK then its perfect.
very strange

yeah Julies code give me a hand cursor somehow but still no test message
I am cursed hah
oh well
Alicia Mounier
Registered User
Join date: 17 Oct 2005
Posts: 78
08-05-2007 19:28
did you try here? lol, prolly did. http://www.lslwiki.net/lslwiki/wakka.php?wakka=control

especialy here

integer pressed = held & change;
integer down = held & ~change;
integer released = ~held & change;
integer inactive = ~held & ~change;
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
08-05-2007 21:40
From: JackInThe Schnook
yes my logic is weird haha
Still nothing yet though and I tried the ones you guys posted and have nothing happening still.

But if I change to using CONTROL_BACK then its perfect.
very strange

yeah Julies code give me a hand cursor somehow but still no test message
I am cursed hah
oh well
You are grabbing that control right, in your llTakeControls() call?
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
08-06-2007 10:31
Post your entire code :)