Mouse Wheel Direction



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

    On 05/09/2011 at 19:18, xxxxxxxx wrote:

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

    ---------
    Is there a way to capture the direction that the mouse wheel is turning and how much it has turned?

    Thanks,

    I can capture if the mouse wheel is turning by doing this...

      
      
    //Check for right clicks and middle wheel clicks  
      win->MouseDragStart(button,mx,my,MOUSEDRAGFLAGS_DONTHIDEMOUSE|MOUSEDRAGFLAGS_NOMOVE);  
      while (win->MouseDrag(&dx,&dy,&device)==MOUSEDRAGRESULT_CONTINUE)  
      {  
            
              GeSyncMessage(EVMSG_ASYNCEDITORMOVE);  
              BaseContainer bc = BaseContainer();  
                
              win->BfGetInputEvent(BFM_INPUT_MOUSE, &bc);  
              if (bc.GetLong(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSEWHEEL)  
              {  
                  GePrint("MOUSE WHEEL SPINNING");  
              }  
      
      }  
      
      
    

    I am unsure how to determine which direction the mouse is spinning and how much it has spun.  :)

    Any help would be greatly appreciated.

    Shawn



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

    On 12/09/2011 at 02:48, xxxxxxxx wrote:

    Some code direct from the liquidtool.cpp example  😉

      
    bc=BaseContainer();  
    win->BfGetInputEvent(BFM_INPUT_MOUSE,&bc);  
    if (bc.GetLong(BFM_INPUT_CHANNEL)==BFM_INPUT_MOUSEWHEEL)  
    {  
      rad+=bc.GetReal(BFM_INPUT_VALUE)/120.0;  
      rad=FCut(rad,RCO 0.1,RCO MAXRANGE);  
      GePrint(RealToString(rad));  
    }  
    

    cheers,
    Matthias


Log in to reply