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%3E%E9%BC%A0%E6%A0%87%E7%9B%92-%E6%8C%89%E9%92%AE%E5%90%91%E4%B8%8A%E7%9A%84%E5%8A%A8%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%AF%B9%E4%BA%8E%E9%BC%A0%E6%A0%87%E6%A1%86%EF%BC%8C%E6%96%B9%E6%B3%95%E9%80%9A%E8%BF%87%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3C%2FFONT%3E%20%3CSETCLICKENABLE%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3C%2FFONT%3E%3C%2FFONT%3E%20%3CSETCLICK%3E%3C%2FSETCLICK%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CBR%20%2F%3E%3C%2FFONT%3E%E2%80%9C%E7%81%AB%E7%81%BE%E2%80%9D%E5%8F%91%E7%94%9F%E5%BE%97%E5%A4%AA%E9%A2%91%E7%B9%81%E4%BA%86%E3%80%82%3CBR%20%2F%3E%E6%B7%BB%E5%8A%A0%E5%81%9C%E6%BB%9E%E6%97%B6%E9%97%B4%E4%BC%9A%E8%AE%A9%E4%BA%BA%E6%84%9F%E8%A7%89%E9%9D%9E%E5%B8%B8%E6%BB%9E%E5%90%8E%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E9%BC%A0%E6%A0%87%E7%89%9B%E5%9C%A8%E6%9D%BE%E5%BC%80%E6%8C%89%E9%92%AE%E6%97%B6%E4%B9%9F%E4%BC%9A%E2%80%9C%E5%BC%80%E7%81%AB%E2%80%9D%E5%90%97%EF%BC%9F%E6%98%AF%E5%90%A6%E6%9C%89%E7%89%B9%E6%AE%8A%E8%AE%BE%E7%BD%AE%EF%BC%9F%3C%2FFONT%3E%3C%2FSETCLICKENABLE%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%E5%8F%A6%E4%B8%80%E6%96%B9%E9%9D%A2%EF%BC%9A%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E5%83%8F%20IS%20CTRL()%20%E8%BF%99%E6%A0%B7%E7%9A%84%E5%87%BD%E6%95%B0%E6%9D%A5%E8%BF%94%E5%9B%9E%E9%BC%A0%E6%A0%87%E6%8C%89%E9%92%AE%E7%9A%84%E5%BD%93%E5%89%8D%E7%8A%B6%E6%80%81%EF%BC%9F%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CLINGO-LABS%20id%3D%22lingo-labs-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8A%A8%E5%8C%96%E5%92%8C%E8%84%9A%E6%9C%AC%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FFONT%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E9%BC%A0%E6%A0%87%E7%9B%92%20-%20%E6%8C%89%E9%92%AE%E5%90%91%E4%B8%8A%E7%9A%84%E5%8A%A8%E4%BD%9C%EF%BC%9F%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%3CCODE%20class%3D%22%20language-jsl%22%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%3E%E8%AF%A5%E8%A7%86%E9%A2%91%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E5%A4%84%E7%90%86%E4%B8%AD%E3%80%82%E8%AF%B7%E5%87%A0%E5%88%86%E9%92%9F%E5%90%8E%E9%87%8D%E8%AF%95%E3%80%82%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%EF%BC%88%E5%9C%A8%E6%88%91%E7%9A%84%E5%BD%B1%E7%89%87%E4%B8%AD%E6%9F%A5%E7%9C%8B%EF%BC%89%3C%2FA%3E%3C%2FDIV%3EYou%20might%20want%20to%20ignore%20Moved%20as%20well%20as%20Ticked.%3CP%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E9%BC%A0%E6%A0%87%E7%9B%92%26lt%3B%20%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%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%3E%E4%B8%89%E4%B8%AA%20JSL%20%E5%A4%8D%E6%B4%BB%E8%8A%82%E5%BD%A9%E8%9B%8B%3C%2FA%3E%3C%2FSETCLICK%3E%3C%2FP%3E%3C%2FCODE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E9%BC%A0%E6%A0%87%E7%9B%92%20-%20%E6%8C%89%E9%92%AE%E5%90%91%E4%B8%8A%E7%9A%84%E5%8A%A8%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E8%B0%A2%E8%B0%A2%E3%80%82%E5%A4%AA%E6%A3%92%E4%BA%86%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%E5%9C%A8%E8%84%9A%E6%9C%AC%E7%B4%A2%E5%BC%95%E4%B8%AD%E6%9C%89%E9%9D%9E%E5%B8%B8%E8%AF%A6%E7%BB%86%E7%9A%84%E8%AE%B0%E5%BD%95%20-%20%E6%88%91%E6%80%8E%E4%B9%88%E4%BC%9A%E9%94%99%E8%BF%87%E5%AE%83......%3C%2FP%3E%3CP%3E%20%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  ...