[Closed] keypress callback
How do I create dot net based call back to activate a small function (playsound()) on a keyboard press? Thank you for your time.
Oh just generally in max …the documentation seems to cover just shift alt ctrl presses for custom shortcuts…
well there is the dotnetform … dotnetObjectSystem.Windows.Forms.Keys…not sure how to implement…
Using the windows.forms keyup and keydown events will only be relevant if a form has focus.
For a general 3dsmax callback you need to either:
- define a low-level callback (there’s a thread here somewhere about a low-level mouse callback, maybe that can be a start)
- define you action as a macroscript and find away to automatically assign it to a hotkey
For the latter part, have a look at either:
http://code.google.com/p/outliner/source/browse/trunk/maxscript/script/keyboardActionsFile.ms
for a maxscript way of automatically assigning a hotkey, or here
http://code.google.com/p/scriptcenter/source/browse/trunk/ScriptCenter/ScriptCenter/Max/KbdFile.cs
http://code.google.com/p/scriptcenter/source/browse/trunk/ScriptCenter/ScriptCenterTest/Max/KbdFileTest.cs
for a .NET implementation and its unit tests for usage examples.