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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Mouse Drag with keyboard input

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 361 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 19/03/2005 at 15:33, xxxxxxxx wrote:

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

      ---------
      Hi,

      I am creating a ToolData plugin, and I would like to do a certain action when the mouse has moved, but while I press certain keys on the keyboard.

      My first idea was to create a MouseDrag routine in ToolData::MouseInput, but while the drag is in process, the ToolData::KeyboardInput method is not called. So I cannot recieve which key has been pressed.

      To combat this, I decided to transfer my code into ToolData::GetCursorInfo, and calculate the mouse position myself to simulate dragging.
      This worked fine until the mouse cursor left the viewport window, which stopped my plugin from performing what its suppsoed to do.

      Is there anyway I can retrieve keyboard input while a drag is in process?
      I can recieve the state of keys such as SHIFT, CTRL etc, by using

        
                BaseContainer keyResult;  
                GetInputState(BFM_INPUT_MOUSE,BFM_INPUT_MOUSELEFT,keyResult);  
                if ((keyResult.GetLong(BFM_INPUT_QUALIFIER) & QSHIFT) != 0)  
                     GePrint("Shift pressed");  
      

      But I'm looking to find out what keys A,B,C,D....etc has been pressed.

      Thanks

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 19/03/2005 at 16:24, xxxxxxxx wrote:

        Solved

          
        GetInputState(BFM_INPUT_KEYBOARD, 'A', keyResult);  
        GePrint(LongToString(keyResult.GetData(BFM_INPUT_VALUE).GetLong()));  
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 19/03/2005 at 16:34, xxxxxxxx wrote:

          Not quite solved

          It only works if the mouse actually moves. If I just hold the mouse button down, without moving the cursor, and press A. Then it won't work

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 25/03/2005 at 12:57, xxxxxxxx wrote:

            What does your polling loop look like for the mouse drag and where did you add the GetInputState()?

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