You could loop over all the menu items, similar to this:
https://github.com/dbr/tabtabtab-nuke/blob/7a98c5458c3d49be70ab2250ebd33f5d6ba96230/tabtabtab.py#L25
..then get the shortcut using the "nuke.MenuItem.shortcut" method.

If you want to do this more reliably, you can parse the "Ctrl+C"-type strings with PySide.QtGui.QKeySequence


Or more simply, you can parse the string returned by nuke.hotkeys():

print "\n".join([x.strip()
    for x in nuke.hotkeys().splitlines()
    if "Shift+D" in x]) # Check for Shift+D

It's worth bearing in mind that shortcuts might only apply in certain parts of the UI (e.g the viewer, or the node graph), and there are some hardcoded shortcuts, particularly in the viewer (e.g the r/g/b, z/x/c/v shortcuts)

Oh, also on OS X and Linux any key involving the "meta" modified is free by default (the windows key)

On 23/08/13 05:23, Elias Ericsson Rydberg wrote:
I guess it would be possible to list all commands hotkeys in some way
through python? As far as I know nuke usually uses lower case characters
as hotkeys, therefore I usually assign upper case ones to my gizmos and
scripts. Before assigning I simply test if the hotkey does anything.

But If wanted to satisfy your question I would have to feed python with
abcd.../ABCD... and another round with Ctrl+abcd.../ABCD...

But as far as I know there isn't a way to have python return a node or
function from such input. Maybe there is some workaround to do this. But
then again, you could probably just as well use the hotkey cheat-sheet
that used to be available on nukepedia.

Cheers,
Elias

22 aug 2013 kl. 18:44 skrev "Diogo Girondi" <diogogiro...@gmail.com
<mailto:diogogiro...@gmail.com>>:

I have done a hack here to check if a certain hotkey collides with a
existent one. But I don't have this code at hand now.

Cheers,
Diogo


On Thu, Aug 22, 2013 at 1:13 PM, Ari Rubenstein <a...@blueskystudios.com
<mailto:a...@blueskystudios.com>> wrote:

    Is there a way to identify which hotKeys are Not in use in Nuke ?

    thx,

    --
    Ari Rubenstein
    Lead Compositor
    www.blueskystudios.com <http://www.blueskystudios.com>


_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk
<mailto:Nuke-users@support.thefoundry.co.uk>,
http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

--
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to