Notifications
Clear all

[Closed] Is "while keyboard button pressed/held do" possible?

Hi,

is it possible to make a script that runs while a certain keyboard shortcut is held? Couldn’t find anything in maxscript help or google.

Thanks

31 Replies

I just used a timer, and on tick did a check for if the shift key was pressed and rotated an object.

I’ve never learned how to use anything other than shift,ctrl and alt for keys though

 PEN

You can use dotNetClass “system.control” to be able to access mouse buttons and keyboard buttons and you will not be limited to what you can access.

Could you possibly provide an example if it’s not too much trouble :).

 PEN

I’m not sitting at max so this is off the top of my head.

DnControl=dotNetClass "system.control"
If DnControl.keyBoard==DnControl.keyBoard.atl do...

Hmm, ok. Max says it’s undefined, and can’t find keyboard in undefined.

I’ll poke around the web and see if I can find anything

thanks!

 PEN

I will be in front of max tomorrow if you are still having issues.

Ok, cool. Yeah, still not sure how to get it to work. I can’t find that command on the MSDN either.

Thanks guys, but for me .net is just too much, I’m happy I can do a bit in maxscript

 PEN

I wasn’t even close.

con=dotNetClass "system.windows.forms.control"
showProperties con
showProperties con.modifierKeys

if con.modifierKeys==con.modifierKeys.alt do...

I left the showProperties in there so you understand where the information came from.

Page 1 / 3