Notifications
Clear all

[Closed] Button press/releas affection

Hello

In Maya, you can assign commands to a button when it get pressed and another when it gets released.
Say, the snap toggle could be instead turned on when a button pressed and turned off on release.
I know that some issues are there in a particular software and not in another software because of a software’s internal structure.

However, I know that in 3dsmax, there is a support for press/release, for example when you make a motion-capture using buttons.

Can someone inform me how I could do for example a snap for in that press/release manner?
thank you!

2 Replies

Do you mean something like this?:

rollout foo "Untitled" width:162 height:100
(
	checkButton chkButton "Press me!"
	
	fn checkFunction = (
		messageBox "checked!"
	)

	fn uncheckFunction = (
		messageBox "unchecked!"
	)
	
	on chkButton changed state do (
		if state then (
			checkFunction()
		)
		else (
			uncheckFunction()
		)
	)
)

createDialog foo

This will create a button with two states, checked and unchecked. And for each state a different function is called.

Hola Jonathan, thanx for your reply.

Obviously , my english wasn’t really correct here. Of course, I was meaning a key on the keyboard
Can this be done?

Think of S for Snap. I want to hold S and have snap turned on, and when I release S I am out of the snap-mode.

thank you again!