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

    TreeViewFunctions::InputEvent() CTRL+A

    SDK Help
    0
    3
    314
    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 29/03/2013 at 07:13, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      I'm trying to catch when the user pressed Ctrl + A on the keyboard. But when the Ctrl qualifier
      is set, BFM_INPUT_ASC is an empty string.

      The following is the output for the following actions:

      • Click
      • Pressing 'a'
      • Click
      • Pressing Ctrl + 'a'
      MaskExportTreeModel::InputEvent
      BFM_INPUT_VALUE: 1
      BFM_INPUT_ASC: 
      MaskExportTreeModel::InputEvent
      BFM_INPUT_VALUE: 1
      BFM_INPUT_ASC: a
      MaskExportTreeModel::InputEvent
      BFM_INPUT_VALUE: 1
      BFM_INPUT_ASC: 
      MaskExportTreeModel::InputEvent
      BFM_INPUT_VALUE: 1
      BFM_INPUT_ASC: 
      CTRL!!
      

      And this is the corresponding code:

      Bool MyTreeViewFunctions::InputEvent(void* root, void* ud, GeUserArea* area,
                                           const BaseContainer& msg) {
          GePrint(__FUNCTION__);
          GePrint("BFM_INPUT_VALUE: " + LongToString(msg.GetLong(BFM_INPUT_VALUE)));
          GePrint("BFM_INPUT_ASC: " + msg.GetString(BFM_INPUT_ASC));
        
          if (msg.GetLong(BFM_INPUT_QUALIFIER) & QCTRL) {
              GePrint("CTRL!!");
          }
        
          return TreeViewFunctions::InputEvent(root, ud, area, msg);
      }
      

      Pressing Ctrl alone does not trigger an Input event, only when pressing Ctrl + 'some key' triggers
      the method. But the key pressed together with the qualifier is not given. How can I catch the
      Ctrl + 'a' key-press correctly?

      Thanks!

      -Niklas

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

        On 29/03/2013 at 23:01, xxxxxxxx wrote:

        This should give you the ASCII decimal value for the key:

        LONG chn = msg.GetLong(BFM_INPUT_CHANNEL);
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 30/03/2013 at 00:32, xxxxxxxx wrote:

          Thank you David, that's it!

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