justinfx / MayaSublime

Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
MIT License
149 stars 38 forks source link

how can i alter "ctrl+enter" to "ctrl+alt+enter"? #32

Closed z369894 closed 5 years ago

z369894 commented 7 years ago

such as title...

justinfx commented 7 years ago

Your title leaves questions still, so please try and explain your complete request. Do you only want to define a new hotkey for the "send to Maya" command or do you want to replace (unmap) the old one as well?

Creating a new hotkey mapping is simple. Just go to your preferences and open your keymap settings for Sublime. Then enter something similar to copying the default keymap:

{ 
    "keys": ["ctrl+alt+enter"], 
    "command": "send_to_maya",
    "context": [{"key": "selector", "operator": "equal", "operand": "source.python"}]
}

If you also want to unmap the previous default keymap, SublimeText does not offer an official way to do this yet. But something like this has been suggested :

{ "keys": ["ctrl+enter"], "command": "noop" }

Does this solve your issue?

m3trik commented 7 years ago

Also just a quick idea. I use the 'chain of command package' to tie a save to my send to maya command. Perhaps not the behavior you want but seemed somewhat related so I thought id mention it.

z369894 commented 7 years ago

I always use Sublime's "ctrl+enter" shortcuts, when I use MayaSublime, I can't use it. so, I want to modify.

justinfx commented 7 years ago

Do your custom keymap shortcut settings not override the default shortcut provided by MayaSublime? I was under the impression that if you set the key to another command that it would take precedence over defaults.