Home Technical Talk

3ds max - use 'tab' button as a hotkey?

Karaoke_Warrior
polycounter lvl 13
Offline / Send Message
Karaoke_Warrior polycounter lvl 13
Is it possible, through some witchery or text file editing, to unlock the tab button in Max for use as a hotkey (ctrl+tab, alt+tab, shift+tab, etc)?

Max ignores the tab key when I'm trying to assign it in the Custom User Interface Keyboard window.

Replies

  • ZombieWells
    Options
    Offline / Send Message
    ZombieWells polycounter lvl 12
    you can't currently do this in max.... wish you could! but NO. As a side, you can do this in MODO... something to look in to if you haven't already. If you want more hot keys, check this out http://www.autohotkey.com/ a super handy to know. Good luck!
  • demilich
    Options
    Offline / Send Message
    demilich polycounter lvl 8
    yes this is possible with autohotkey. For example,
    you can make autohotkey send ctrl alt shift in 3ds max by just pressing tab.
    so tab-A would send ctrl alt shift A to 3ds max.
  • spacefrog
    Options
    Offline / Send Message
    spacefrog polycounter lvl 15
    You can hack the TAB key directly into the *.kbdx config file, using tab's virtual key code ( being "0x09" ). Together with the Max internal action provided to toggle floating windows, you are able to simulate the sub-window toggling using the tab key, like Adobe does it in Photoshop for example

    For Max 2013 and up:
    simply add the following line to your existing *.kbdx file, somewhere between the <ADSK_KBD> </ADSK_KBD> pair. Be sure to edit the correct *.kbdx file
    <shortcut fVirt="3" accleleratorKey="9" actionID="63446" actionTableID="0" />
    
    To use TAB in combination with some modifier keys ( shift, ctrl etc... ), one has to set the fVirt - code accordingly. fVirt is bitwise encoded, so you might figure out modifier combinations like Shift-Ctrl yourself ...

    For Max 2012 and below:
    Here you only got the legacy *.kbd files of course, but the format for this file is only slightly less readable. Just add the following entry to the end of your file, when you are on Max 2012 or below
    0=3 9 63446 0
    
    You might wonder why the first number (which is a running index) is "0" while in your *.kbd file are many higher indices. The great thing is that Max rebuilds those indices each time , so this entry will get the correct index after the *.kbd file gets written out again. Other than that, everything in Max 2012 and below seems to work as it did in Max 2013 and up...


    Modifier key encoding ( Max 2013+: fVirt entry; Max2012 and below: first number after the "=" )
    3 ... no modifier key
    7.... Shift
    11... Ctrl
    19... Alt
    
    Just a word of warning:
    As this is surely untested you might run in problems using this method to assign the TAB key. Usually it is used to tab through sub-controls, which now may be troublsome on some occasions. A quick test showed that when tabbing through number entry fields, the tab is not sent to the parent window ( to trigger the window hiding), but cycles according to tab order ...
  • Michael Knubben
    Options
    Offline / Send Message
    This would make tabbing through input fields and alt-tabbing fail to work, which I'm not sure the OP is willing to give up. At least, I wouldn't!
  • spacefrog
    Options
    Offline / Send Message
    spacefrog polycounter lvl 15
    MightyPea wrote: »
    This would make tabbing through input fields and alt-tabbing fail to work, which I'm not sure the OP is willing to give up. At least, I wouldn't!

    As i have written above, tabbing still works on subcontrols (including input fields), the windows hiding only triggers when no subcontrol has focus ..
  • spacefrog
    Options
    Offline / Send Message
    spacefrog polycounter lvl 15
    perna wrote: »
    :) As long as the viewport is active, the TAB customization works.

    IT works even in a way like, let'S say you tab-cycle through some input fields in the material editor and click somewhere on the Mated's empty region. So any keypress that is'nt consumed by a sub-control because it has focus ( button, checkbox, input field ) reaches the main input loop finally and triggers the keyboard shortcut

    BTW: it'S not perfect though, seems like some windows like Trackview does'nt react to the "Floating Window toggle", so this might require some scripting to really make it a complete feature...
  • spacefrog
    Options
    Offline / Send Message
    spacefrog polycounter lvl 15
    I added a solution for Max 2012 and below too, as i forgot to mention that the first method only works on Max 2013 and up )
    Just see my initial post above
  • Karaoke_Warrior
    Options
    Offline / Send Message
    Karaoke_Warrior polycounter lvl 13
    Thanks for the replies guys, but I'm sure I don't understand it correctly.

    First, I have to hack Tab (0x09) into my kbdx file into the line of the hotkey I want it to access?

    So this shortcut that cycles my viewports

    <shortcut fVirt="3" accleleratorKey="97" actionID="CycleView`CycleView" actionTableID="647394" />

    becomes

    <shortcut fVirt="3" accleleratorKey="0x09" actionID="CycleView`CycleView" actionTableID="647394" />

    or

    <shortcut fVirt="3" accleleratorKey="9" actionID="CycleView`CycleView" actionTableID="647394" />

    I assume accleleratorKey is where I plug in the virtual keycode. Then I pair it with

    <shortcut fVirt="11" accleleratorKey="9" actionID="63446" actionTableID="0" />

    By changing fVirt to 11 I'm enabling the use of ctrl+tab to access the hotkey which cycles my viewports. I'm pretty sure I got it wrong cause it isn't working.
  • spacefrog
    Options
    Offline / Send Message
    spacefrog polycounter lvl 15
    Don't understand what you mean by "pair it with", but i think it should work when you simply add
    <shortcut fVirt="11" accleleratorKey="9" actionID="CycleView`CycleView" actionTableID="647394" />
    to your *.kbdx file ( best would be "maxstartUI.kbdx" since this getst loaded at startup ), and start Max. This asumes that there is indeed a "CycleView action available. I do not have this in my Max versions, so it has to be some external macroscript you have installed. Generally speaking, it's in the nature of hacks that they might not work as expected
  • Karaoke_Warrior
    Options
    Offline / Send Message
    Karaoke_Warrior polycounter lvl 13
    Hey guys, thanks for the help ..the code above worked. I'm able to use tab now as a hotkey. I also changed the cycleview category to a more appropriate script category.

    The only restriction is that the tab key only works with 3 (no modifier key) and 7 (shift). It would've been nice to be able to use ctrl, but you take what you can get. Other than that, it works as expected.
  • Toku
    Options
    Offline / Send Message
    Toku polycounter lvl 6
    Necrothread just because I found an sweet setup using the information here. Add these to your hotkeys file:
       
    <shortcut fVirt="3" accleleratorKey="9" actionID="272" actionTableID="0" />
    <shortcut fVirt="7" accleleratorKey="9" actionID="369" actionTableID="0" />

    Tab: Toggle transparency/wireframe
    Shift+Tab: Toggle wireframe overlay


  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Hi there,

    Keyhydra was designed to be able to add any shortcut to any key. Thanks to it i can use 'Print' key, 'Pause' key, 'Numlock' key, 'Insert' key, 'delete key', 'home key', etc ... Tab can be used as well. There is a trial over the website you can try it by yourself. http://www.onikanabo.com/keyhydra

Sign In or Register to comment.