       "mouseup"   : @mouseUp
 
     $(@target).on 
-      "mouseup"   : @mouseUp
       "mousedown" : @mouseDown
       "mouseenter" : @mouseEnter
       "mousewheel" : @mouseWheel

      @changedCallbackY distY * User.Configuration.mouseRotateValue if distY isnt 0

  mouseEnter : (evt) =>
    if !(evt.which == 1) and @activeCallback?
      @activeCallback()

  mouseWheel : (evt, delta) =>
    if @changedCallbackMW?
      @changedCallbackMW(delta)
      return false      # prevent scrolling the web page
    
  mouseDown : (evt) =>
    # check whether the mouseDown event is a rightclick
    if evt.which == 3
      # on rightclick, return mouse position relative to the canvas
      @changedCallbackR [evt.pageX - $(@target).offset().left, evt.pageY - $(@target).offset().top], 0
    else
      if @activeCallback?
        @activeCallback()

  # HTML object where the mouse attaches the events
  ###
  constructor : (target, activeCallback) ->
    @target = target

    @activeCallback = activeCallback
