cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMouse%20box%20-%20action%20for%20button%20up%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFor%20Mouse%20box%20%2C%20the%20approach%20via%26nbsp%3B%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3CSETCLICKENABLE%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3CSETCLICK%3E%3C%2FSETCLICK%3E%3CBR%20%2F%3E%3C%2FFONT%3E%22fires%22%20too%20often.%3CBR%20%2F%3EAdding%20a%20dead%20time%20feels%20extremely%20laggy.%3CBR%20%2F%3E%3CBR%20%2F%3EDoes%20the%20Mouse%20ox%20also%20%22fire%22%20when%20the%20button%20is%20released%3F%20Is%20there%20a%20special%20setting%3F%3C%2FSETCLICKENABLE%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20the%20other%20hand%3A%20is%20there%20some%20function%20like%20IS%20CTRL()%20which%20returns%20the%20current%20status%20of%20the%20mouse%20buttons%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomation%20and%20Scripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Mouse%20box%20-%20action%20for%20button%20up%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ew%20%3D%20New%20Window(%20%22Mouse%20Messages%22%2C%20%2F%2F%20modified%20from%20scripting%20index%20setClick%0A%09Border%20Box(%20Left(%2020%20)%2C%20Right(%2020%20)%2C%20top(%2020%20)%2C%20bottom(%2020%20)%2C%0A%09%09MouseBox(%20%2F*%20%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20handler%20for%20mouse%20events%20*%2F%0A%09%09%09window%3Atb%20%3D%20Text%20Box(%20%22click%20me!%22%2C%20%26lt%3B%3CSETFONTSIZE%3E%3C%2FSETFONTSIZE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3C%2FP%3E%3CDIV%20class%3D%22lia-vid-container%20video-embed-center%20lia-video-unavailable%22%3E%3CDIV%20id%3D%22lia-vid-6362132885112w400h300r408%22%20class%3D%22lia-video-ooyala-player-container%22%3E%3CDIV%20class%3D%22lia-video-status-message%22%3EThis%20video%20is%20currently%20being%20processed.%20Please%20try%20again%20in%20a%20few%20minutes.%3C%2FDIV%3E%3C%2FDIV%3E%3CA%20class%3D%22video-embed-link%22%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fvideo%2Fgallerypage%2Fvideo-id%2F6362132885112%22%20target%3D%22_blank%22%3E(view%20in%20My%20Videos)%3C%2FA%3E%3C%2FDIV%3EYou%20might%20want%20to%20ignore%20Moved%20as%20well%20as%20Ticked.%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMouseBox%26lt%3B%3CSETCLICK%20example%3D%22%22%20in%3D%22%22%20the%3D%22%22%20scripting%3D%22%22%20index%3D%22%22%20is%3D%22%22%20one%3D%22%22%20of%3D%22%22%20the%3D%22%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FUncharted%2FThree-JSL-Easter-Eggs%2Fm-p%2F21181%23U21181%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-blog-thread%20lia-fa-icon%20lia-fa-blog%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3EThree%20JSL%20Easter%20Eggs%3C%2FA%3E%26nbsp%3B%3C%2FSETCLICK%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERe%3A%20Mouse%20box%20-%20action%20for%20button%20up%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EThanks.%20wonderful%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3Every%20well%20documented%20in%20the%20scripting%20index%20-%20how%20could%20I%20miss%20it%26nbsp%3B%20...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
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  ...