Talk:Control

From Second Life Wiki
Jump to navigation Jump to search

unheld

Is this code snippet right?

       integer start = level & edge;
       integer end = ~level & edge;
       integer held = level & ~edge;
       integer unheld = ~(level & edge);

unheld would be true for any bit that had a falling edge, was held high, or was held low. I think that last line should be...

       integer unheld = ~(level | edge);

...or the equivalent...

       integer unheld = ~level & ~edge;

With this new code, unheld would be true for any bit that was held low.

---

*kicks self* you are correct, I'll correct that, good catch. for some reason I though ~(level & edge) was going to be equivelent to ~level & ~edge. Strife Onizuka 11:42, 2 March 2007 (PST)