2015-01-11 63 views
0

我正在使用acrobat js在3D注释中更改默认的鼠标行为。我定义了六个主要视图,我希望用户只能从这些视图查看模型。应该禁用模型与鼠标的默认翻滚。我希望用户仍然能够使用3D注释工具栏提供的其他功能。3D PDF acrobat javascript

我想过要停止鼠标事件的传播,所以这里是我的尝试

myAnnotsQ13D = getAnnots3D(0)[0]; 
if(myAnnotsQ13D.activated){ 

    c3D = myAnnotsQ13D.context3D; 
    mouseEventHandler = c3D.MouseEventHandler(); 
    mouseEventHandler.onMouseDown = true; 
    mouseEventHandler.onMouseMove = true; 
    mouseEventHandler.onMouseUp = true; 

    mouseEventHandler.onEvent = function(event){ 
    event.stopAllDispatch = true; 
    } 
    c3D.runtime.addEventHandler(mouseEventHandler); 
} 

此代码似乎并没有做任何事情。我仍然可以用鼠标旋转模型。有什么建议么?

回答

0

得到了LinkedIn 3DPDF论坛的答案,就像一个魅力

myAnnotsQ13D = getAnnots3D(0)[0]; 
if(myAnnotsQ13D.activated){ 

    c3D = myAnnotsQ13D.context3D; 
    c3D.runtime.overrideRotateTool = true; // add these two lines to disable mouse tumbling 
    c3D.runtime.overrideSpinTool = true; 

    mouseEventHandler = c3D.MouseEventHandler(); 
    mouseEventHandler.onMouseDown = false; 
    mouseEventHandler.onMouseMove = false; 
    mouseEventHandler.onMouseUp = true 

    mouseEventHandler.onEvent = function(event){ 
    var field = getField("NoOfClicksIM"); 
    field.value = ++noOfClicksIM; 
    } 
    c3D.runtime.addEventHandler(mouseEventHandler); 
} 
相关问题