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

    MouseInput

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 577 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 08/05/2012 at 03:30, xxxxxxxx wrote:

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

      ---------
      Hi All,
       
      Is it possible to set the mouse position and input? I see you can get the position/input, but can you set it?
       
      WP.

      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 08/05/2012 at 05:09, xxxxxxxx wrote:

        Nope.  That is a system-level feature.  You may be able to do it at that level but you would need to use system calls (Windows/MacOS).

        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 08/05/2012 at 05:29, xxxxxxxx wrote:

          Thanks Rob,
          I thought that may be the case. I've seen examples on how it can be done at a system level, so looks like I'll have to try that instead.
           
          This raises another question though. If this is done through the system calls, are the #include "windows.h" files generally located in the same directory on all machines? Like all the Cinema ones?
           
          For example, if I compile the plugin with the windows.h header, will the plugin 'generally' work on all windows machines? Or is this a machine specific request?

          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 08/05/2012 at 06:58, xxxxxxxx wrote:

            OK - I'm managing to get the mouse to move - so it's a start!
            That'll give me something to go on with in the morning.

            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 09/05/2012 at 20:22, xxxxxxxx wrote:

              Alrighty, I can virtually execute the mouse in any way I want - moving around, clicking buttons etc, however the viewport doesn't seem to respond to the actions properly.
               
              I'm simply trying to execute a selection drag in the viewport, but at specific coordinates. The coordinates I can get, the selection drag I can't.

              int X = 500;    // for testing purposes  
              int Y = 250;    // for testing purposes  
              CallCommand(200000084);
              int begin = SetCursorPos(X,Y);  
              mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, NULL);  
              int end = SetCursorPos(X+500,Y+250);  
              mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, NULL);
              

              Please note: mouse_event is now deprecated but it's easier to get working than SendInput for the time being. Also, the coordinates are made to fit my screen but you may need to adjust them for yours if you test it out.
               
              Is there something going on in the viewport that might be preventing such actions? Or maybe the rectangle tool itself can't be actioned virtually? Any thoughts?
               
              WP.

              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 17/05/2012 at 05:56, xxxxxxxx wrote:

                Hi folks,
                 
                when a mouse is dragged, and then let go, is there a message that is sent to let the tool/Cinema know it's completed the action? Some sort of core message perhaps on (for examle) the left mouse button up?
                 
                For example - in my function, if I don't use the left mouse up flag the tool stays highlighted and the rectangle is seen in the viewport. So my function is working, but the left mouse up doesn't seem to complete the action. Is there a flag or core message of some sort I should be sending, or that Cinema needs to enable the selection to take place, or for the tool to be 'actioned'?
                 
                WP.

                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 17/05/2012 at 09:43, xxxxxxxx wrote:

                  No. There is no mouse up event.
                  You have to handle that type of situation with a while loop.

                  See "InputEvents" in the SDK. And look at the bottom of the page where it talks about Continuous Polling.

                  -ScottA

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