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 down, not mouse drag

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 313 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 21/10/2012 at 08:36, xxxxxxxx wrote:

      Hey guys.
      Just stumbled upon this: can you determine if the mouse button is pressed but not releasedand execute something while it is pressed?
      I'm working on a tool-plugin and can fake it by using mousedrag, but then in fact you have to drag the mouse at least one pixel. I want to give some visual feedback while the button is pressed but the mouse not dragged.
      Is this possible?
      Thanx
      Phil

      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 22/10/2012 at 06:56, xxxxxxxx wrote:

        Hi Phil,

        Here's how you can determine if a mouse button is pressed, mouse left is tested in this example:

        def MouseInput(self, doc, data, bd, win, msg) :
          
            if msg.GetLong(c4d.BFM_INPUT_CHANNEL)==c4d.BFM_INPUT_MOUSELEFT:
                print "Begin Mouse Left Pressed"
          
                while True:
          
                    bc = c4d.BaseContainer()
                    if gui.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, bc) :
                        if bc.GetLong(c4d.BFM_INPUT_CHANNEL)==c4d.BFM_INPUT_MOUSELEFT:
                            print "Mouse Left Pressed"
                            if not bc.GetBool(c4d.BFM_INPUT_VALUE) : break
          
                print "End Mouse Left Pressed"
          
            return True
        

        c4d.BFM_INPUT_VALUE tells if a channel is active or not; if it's false the loop is ended.

        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 22/10/2012 at 07:34, xxxxxxxx wrote:

          Thank you very much,
          works exactly how I wanted. I'll try to wrap my head around it 🙂

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