Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Shortcuts

    SDK Help
    0
    3
    413
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 14/05/2017 at 09:00, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,
      I was playing around with shortcut keys, and wrote the following to detect the used shortcut key for a given plugin.

        
        Int32 nbr = 10;  
        Int32 *idxarray = NewMemClear(Int32, nbr);  
        Int32 ret = FindShortcutsFromID(MY_PLUGIN_ID, idxarray, nbr);  
        
        for (Int32 i = 0; i < ret; i++)  
        {  
            BaseContainer bc = GetShortcut(idxarray[i]);  
        
            Int32 pluginID = bc.GetInt32(SHORTCUT_PLUGINID);  
            Int32 managerID = bc.GetInt32(SHORTCUT_ADDRESS);  
            Bool shortcutOptionMode = bc.GetBool(SHORTCUT_OPTIONMODE);  
        
            Int32 shortcutQualifier = bc.GetInt32(0);  
            Int32 shortcutKey = bc.GetInt32(1);  
        }  
          
        DeleteMem(idxarray);  
      

      But what about multi key shortcuts (example Q~E), only the first key can be obtained with above code. What if I have multiple commands, all assigned multi keys (Q~A, Q~E, Q~R, ...), how to know their "full" shortcut, since the above code will only return "Q" for all of them?

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 15/05/2017 at 10:25, xxxxxxxx wrote:

        Hi,

        for shortcut sequences you find the following keys and qualifiers with an offset of 10 in the container. So 10 and 11 for second qualifier and key, 20, 21 for third,... for up to ten keys.
        Unfortunately I found this documented only in the Python docs on AddShortcut(). Sorry for the inconvenience. We'll fix the docs.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 15/05/2017 at 10:30, xxxxxxxx wrote:

          I tried to read out the container, but stopped at index 7. Should have known better to at least try until 10.
          Ah, never expected the Python docs would have more info than the C++ ones. As such, I didn't think of having a look.
          Thanks for pointing it out.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post