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

    Mouse positions and screen dimensions

    Cinema 4D SDK
    r20 r21 c++
    3
    17
    2.1k
    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.
    • C4DSC
      C4DS
      last edited by

      Any news on this topic.

      I have been able to get something going with R20, on single and multi monitor setup.
      But as mentioned earlier the coordinates returned from R21 don't make sense, and are different if the main Cinema application window is full-screen (on primary monitor) or windowed.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        We asked the dev with all your threads and tests.
        @r_gigante made a bunch of tests also.

        But no news 🙂

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        C4DSC 1 Reply Last reply Reply Quote 0
        • C4DSC
          C4DS @Manuel
          last edited by

          @m_magalhaes said in Mouse positions and screen dimensions:

          But no news 🙂

          Thanks for the update. I guess no news is good news ...

          1 Reply Last reply Reply Quote 0
          • C4DSC
            C4DS
            last edited by

            Hi again,
            It is not my intention to bump this topic every other day, but I just want to know if a response from devs is still in the pipeline.

            So far, it seems that with R21 the obtained mouse coordinates are valid as long as the mouse pointer is hovering over the main Cinema application window. Once outside of that window the obtained coordinates are that of the last position inside the window.
            This means that when the application is not full screen, or when multiple monitors are involved the coordinates outside of the window are useless. Most important is that one cannot find out if the mouse cursor is inside or outside the window and thus decide (or know) the obtained values are useless.

            This isn't an issue with R20.

            On the other hand, as far as I have understood with the release of S22, there will be no further service packs for R21. Which means any fix to this issue (if provided) will be S22 or R22.
            Which brings me to the inevitable decision that I will need to ditch any further development for R21. There just are too many unresolved open issues for any of my current (and work-in-progress) plugins.

            1 Reply Last reply Reply Quote 0
            • ManuelM
              Manuel
              last edited by

              hi,

              no problem to bump it.
              But still no news.

              Cheers,
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • C4DSC
                C4DS
                last edited by

                I am starting to lose hope we'll ever say any update/answer on this topic.

                And as a result I am close to giving up on further R21 development. And beyond.
                For me, there are just too many open issues that don't get resolved (this one included). The cost for finding workarounds, or alternative solutions is just becoming too high, and not worth the effort anymore.

                1 Reply Last reply Reply Quote 0
                • ManuelM
                  Manuel
                  last edited by

                  hi,

                  I apologie for the delay here.
                  you will have an answer for sure, maybe not the one you are waiting for, but you will have one.
                  I was going to talk about that in our daily meeting anyway, but thanks for bumping it again, we asked the dev again 🙂

                  Cheers,
                  Manuel

                  MAXON SDK Specialist

                  MAXON Registered Developer

                  1 Reply Last reply Reply Quote 0
                  • ManuelM
                    Manuel
                    last edited by

                    hi,

                    After talking with dev and few tests:

                    • Mouse data could be outdated when you were calling a command Data via a shortcut. This bug will be fixed in the next update.
                    • GetInputState return coordinate in local to the editor windows space, not in screen space. But this should be used with caution and should probably be used only for keyboard modifier checks.
                    • GetScreenDimensions This was a bit hard to understand what was going on, i must say that i wasn't expecting that.
                      First, the coordinates are relatives to the main display. (not the 1st display, but the display set as "main").
                      as the mouse coordinates wasn't really helpfull you can "force them" to 0,0 and -10,-10

                    d418931d-745f-4301-b869-4facc086b6fe-image.png
                    0c515887-5b3d-4600-91cd-b38da779b7e4-image.png

                    This is my setup and the monitor 2 is in fact my main display.

                    0,0 will return 0,0 / 2560, 1440
                    -10,-10 will return -491, 2069 / -1440, 0

                    and that does make.

                    Cheers,
                    Manuel

                    MAXON SDK Specialist

                    MAXON Registered Developer

                    C4DSC 1 Reply Last reply Reply Quote 0
                    • C4DSC
                      C4DS @Manuel
                      last edited by C4DS

                      @m_magalhaes said in Mouse positions and screen dimensions:

                      Thanks for the detailed response.

                      This bug will be fixed in the next update.

                      Are we still talking R21, or will this be R22?

                      • GetInputState return coordinate in local to the editor windows space, not in screen space. But this should be used with caution and should probably be used only for keyboard modifier checks.

                      If GetInputSate is not to be used to obtain the mouse coordinates, what would be the better way to get the mouse position?

                      1 Reply Last reply Reply Quote 0
                      • ManuelM
                        Manuel
                        last edited by Manuel

                        @C4DS said in Mouse positions and screen dimensions:

                        Are we still talking R21, or will this be R22?

                        it's not a stop seller so it will be probably fixed in R23.

                        Well this is the global function, in a GeDialog you should use GeDialog::GetInputState

                        I need to check the real differences to answer with more details sorry. This is something we need to talk about and document a bit more.

                        Not the answer you were waiting for i know.

                        Cheers,
                        Manuel

                        MAXON SDK Specialist

                        MAXON Registered Developer

                        C4DSC 2 Replies Last reply Reply Quote 0
                        • C4DSC
                          C4DS @Manuel
                          last edited by

                          it's not a stop seller so it will be probably fixed in R23.

                          Oh, I read "the next update" as being "the update right around the corner".
                          Not as if someone saying "the next day" but actually meaning "in a not to near future".
                          But thanks for pointing it out.

                          Well this is the global function, in a GeDialog you should use GeDialog::GetInputState

                          Sorry, I am not in context of a GeDialog, but a CommandData.
                          What other options than the global function do I have here?

                          True, not really the answer I was looking for, but still grateful for the reply. Thank you for that.

                          1 Reply Last reply Reply Quote 0
                          • C4DSC
                            C4DS @Manuel
                            last edited by

                            @m_magalhaes said in Mouse positions and screen dimensions:

                            I need to check the real differences to answer with more details sorry. This is something we need to talk about and document a bit more.

                            Any news or additional info to share on this?

                            1 Reply Last reply Reply Quote 0
                            • ManuelM
                              Manuel
                              last edited by Manuel

                              hi,

                              sorry, it get out of my mind.

                              Cheers,
                              Manuel

                              MAXON SDK Specialist

                              MAXON Registered Developer

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