For Mouse box , the approach via
<<setClickEnable( 1 ),
<<setClick()
"fires" too often.
Adding a dead time feels extremely laggy.
Does the Mouse ox also "fire" when the button is released? Is there a special setting?
On the other hand: is there some function like IS CTRL() which returns the current status of the mouse buttons?
w = New Window( "Mouse Messages", // modified from scripting index setClick
Border Box( Left( 20 ), Right( 20 ), top( 20 ), bottom( 20 ),
MouseBox( /* <<<<<<<< handler for mouse events */
window:tb = Text Box( "click me!", <<setFontSize( 48 ), <<setwrap( 999 ) ), /* <<<<<< child box does not receive the mouse events */
<<setClickEnable( 1 ),
<<setClick( /* button-down, move, button-release handler */
// the Ticked event happens frequently, and makes it hard to see the Pressed event, so ignore it...
Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
If( event != "Ticked",
window:tb << settext( event || Char( clickpt ) );
)
)
)
)
);
);
You might want to ignore Moved as well as Ticked.
MouseBox<<setClick example in the scripting index is one of the Three JSL Easter Eggs
w = New Window( "Mouse Messages", // modified from scripting index setClick
Border Box( Left( 20 ), Right( 20 ), top( 20 ), bottom( 20 ),
MouseBox( /* <<<<<<<< handler for mouse events */
window:tb = Text Box( "click me!", <<setFontSize( 48 ), <<setwrap( 999 ) ), /* <<<<<< child box does not receive the mouse events */
<<setClickEnable( 1 ),
<<setClick( /* button-down, move, button-release handler */
// the Ticked event happens frequently, and makes it hard to see the Pressed event, so ignore it...
Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
If( event != "Ticked",
window:tb << settext( event || Char( clickpt ) );
)
)
)
)
);
);
You might want to ignore Moved as well as Ticked.
MouseBox<<setClick example in the scripting index is one of the Three JSL Easter Eggs
Thanks. wonderful
very well documented in the scripting index - how could I miss it ...