4 Replies Latest reply on Feb 16, 2016 5:14 AM by juergen.dickler

    event epcbMouseEventWheelForward  -- Howto?

    juergen.dickler

      Hi all

      I'm looking for a sample code to implement an event handler, which reacts on mousewheel scrolling.

      I only find the code for acting on clicking a button in command listener. Any ideas?

      Thank you very much.

      Juergen

        • 1. Re: event epcbMouseEventWheelForward  -- Howto?
          kendall_hiles

          I do not have any examples in AATK, I do not like scripts that modify what the out of the box version of the tool does so this is something I would be hesitant to implement.

           

          Can you give me an example of why you want to implement this functionality, just courious.

           

          -kendall

          • 2. Re: event epcbMouseEventWheelForward  -- Howto?
            juergen.dickler

            Hello Kendall

            There is no real need to use epcbMouseEventWheelForward, but I played a bit with the event handler and I was prying how that works.

            • 3. Re: event epcbMouseEventWheelForward  -- Howto?
              juergen.dickler

              Hello to all

              I would like to pick up my question again because I would like to have the Dim Mode and Transparency from Display Control permanently on the mouse wheel in combination wiht shift and ctrl.

               

              Any hints?

               

              Thx. a lot

              • 4. Re: event epcbMouseEventWheelForward  -- Howto?
                juergen.dickler

                If there is no solution for the mousewheel I will use the following solution with commandlistener. ( Maybe interesting for somebody )

                Adding the global Var mouselocX and the function below to the event-handler

                 

                By pressing shift und moving the mouse to the left or right ( without pressing a button on mouse)  Dim mode will be changed

                By pressing ctrl und moving the mouse to the left or right ( without pressing a button on mouse)  Transparency will be changed

                 

                Function com_postonmousemove(eButton, eFlags, dX, dY)
                dim ValueTransparency
                dim ValueDim

                ValueTransparency= ExpActiveDoc.ActiveViewEx.DisplayControl.StringOption( "Global.Option.Transparency" )
                ValueDim= ExpActiveDoc.ActiveViewEx.DisplayControl.StringOption( "Global.Option.DimMode" )

                  if eflags = epcbKeyboardFlagsShiftPressed then
                   if dX < mouselocX and ValueDim > 0 then
                    ExpActiveDoc.ActiveViewEx.DisplayControl.StringOption( "Global.Option.DimMode" ) = ValueDim -2
                   end if
                   if dX > mouselocX and ValueDim < 100 then
                    ExpActiveDoc.ActiveViewEx.DisplayControl.StringOption( "Global.Option.DimMode" ) = ValueDim +2
                   end if
                  end if

                  if eflags = epcbKeyboardFlagsCntrlPressed then
                   if dX < mouselocX and ValueTransparency > 0 then
                    ExpActiveDoc.ActiveViewEx.DisplayControl.StringOption( "Global.Option.Transparency" ) = ValueTransparency -2
                   end if
                   if dX > mouselocX and ValueTransparency < 100 then
                    ExpActiveDoc.ActiveViewEx.DisplayControl.StringOption( "Global.Option.Transparency" ) = ValueTransparency +2
                   end if
                  end if
                  mouselocX = dX
                  com_postonmousemove = false
                End Function