Notifications
Clear all

[Closed] Overide Shortcut in Maxscript

I have an simple Maxscript with UI. When it´s active, i want to overide shortcuts (for example “F9”) to use a function of my script. When the script closed, the shortcuts must be 3dsmax Standard. Is this possible?

Thank you,
oli

3 Replies

Hi,

You can do something similar. ActiveX controls support keypresses, but they have to be in focus for the keypress to work, else it will trigger the action assigned to it in max. It’s relatively easy to set the focus to the activeX control whenever the mouse comes inside the dialog, using a timer.

Light

Thanks a lot Light,

but this means the mouse must be over my UI? Is it possible to use the shortcut only during my Maxcript is active?

oli

Yeah it’s possible. In order for the shortcut to work activeX must be in focus. When it should be is the problem. You have 4 ways to do this:

  1. My first method
  2. Modify the commands so they recognize the dialog is open and act accordingly
  3. Always set the focus to the activeX (less usable, as you will not be able to type something in a textbox)
  4. Create a modified keyboard shortcuts file using the current one, and replace it with yours temporarily when your script is open. The file will have all the shortcuts while replacing the hotkeys used by your script.

What you could choose depends on what you intend to do with the script.

Light