cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
hogi
Level XII

Mouse box - action for button up?

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Mouse box - action for button up?

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 

Craige

View solution in original post

2 REPLIES 2
Craige_Hales
Super User

Re: Mouse box - action for button up?

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 

Craige
hogi
Level XII

Re: Mouse box - action for button up?

Thanks. wonderful  


very well documented in the scripting index - how could I miss it  ...