cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%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%B0%8D%E6%96%BC%E6%BB%91%E9%BC%A0%E7%9B%92%EF%BC%8C%E8%A9%B2%E6%96%B9%E6%B3%95%E9%80%8F%E9%81%8E%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%E3%80%8C%E7%81%AB%E7%81%BD%E3%80%8D%E5%A4%AA%E9%A0%BB%E7%B9%81%E4%BA%86%E3%80%82%3CBR%20%2F%3E%E5%A2%9E%E5%8A%A0%E6%AD%BB%E5%8D%80%E6%99%82%E9%96%93%E6%84%9F%E8%A6%BA%E9%9D%9E%E5%B8%B8%E5%BB%B6%E9%81%B2%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%95%B6%E9%87%8B%E6%94%BE%E6%8C%89%E9%88%95%E6%99%82%EF%BC%8C%E6%BB%91%E9%BC%A0%E7%89%9B%E4%B9%9F%E6%9C%83%E3%80%8C%E9%96%8B%E7%81%AB%E3%80%8D%E5%97%8E%EF%BC%9F%E6%9C%89%E7%89%B9%E6%AE%8A%E8%A8%AD%E5%AE%9A%E5%97%8E%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%E6%9C%89%E5%83%8F%20IS%20CTRL()%20%E9%80%99%E6%A8%A3%E7%9A%84%E5%87%BD%E6%95%B8%E5%8F%AF%E4%BB%A5%E5%82%B3%E5%9B%9E%E6%BB%91%E9%BC%A0%E6%8C%89%E9%88%95%E7%9A%84%E7%9B%AE%E5%89%8D%E7%8B%80%E6%85%8B%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%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%E7%B7%A8%E5%AF%AB%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%E8%A6%86%EF%BC%9A%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%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%A9%B2%E5%BD%B1%E7%89%87%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E8%99%95%E7%90%86%E4%B8%AD%E3%80%82%E8%AB%8B%E5%B9%BE%E5%88%86%E9%90%98%E5%BE%8C%E9%87%8D%E8%A9%A6%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%E6%BB%91%E9%BC%A0%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%E5%80%8B%20JSL%20%E5%BE%A9%E6%B4%BB%E7%AF%80%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%E8%A6%86%EF%BC%9A%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%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%AC%9D%E8%AC%9D%E3%80%82%E7%B2%BE%E5%BD%A9%E7%9A%84%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%E8%85%B3%E6%9C%AC%E7%B4%A2%E5%BC%95%E4%B8%AD%E6%9C%89%E5%BE%88%E5%A5%BD%E7%9A%84%E8%A8%98%E9%8C%84%20-%20%E6%88%91%E6%80%8E%E9%BA%BC%E8%83%BD%E9%8C%AF%E9%81%8E%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  ...