我买了一台Logitech Marble Trackman.我习惯按住一个按钮并将球滚动到linux下滚动.现在我在Win8下工作并安装了Logitech SetPoint.现在我有Universal Scroll和AutoScroll作为选项,并且都锁定了滚动功能.我需要再次单击以停用滚动.
有没有办法只用按钮4保持滚动?
我想听ScrollView看它是否滚动.我使用OnTouchListener,效果很好.但是当我想使用OnKeyListener添加与轨迹球的兼容性或重写OnKeydown方法时,它无法工作.看起来像焦点的儿童按钮导致问题.
解决此问题的任何解决方案或解决方法?任何帮助表示赞赏.
以下是一些重现我的问题的演示代码:
public class TestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ScrollView scrollView = (ScrollView) findViewById(R.id.scroll_view);
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.main_layout);
LinearLayout.LayoutParams wrapParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
for (int i = 0; i < 100; i++) {
MyItem item = (MyItem) LayoutInflater.from(this).inflate(R.layout.item, null);
item.setParent(scrollView);
item.setBackgroundColor(Color.WHITE);
item.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
mainLayout.addView(item, wrapParams);
}
scrollView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// can go into here
}
});
scrollView.setOnKeyListener(new OnKeyListener() {
@Override …Run Code Online (Sandbox Code Playgroud) 我的应用程序要求用户按住轨迹球以访问高级菜单.然而,并非所有手机都有轨迹球,因此我需要删除此类手机的此要求.有没有办法检测手机是否有轨迹球?
function moveCameraTo(position, duration) {
var tween = new TWEEN.Tween( camera.position )
.to( position, duration )
.easing(TWEEN.Easing.Linear.None)
.onUpdate(function () {
camera.position = new THREE.Vector3().copy(position)
camera.lookAt({x:0,y:0,z:0})
})
.onComplete(function () {
camera.lookAt({x:0,y:0,z:0})
})
.start()
}
Run Code Online (Sandbox Code Playgroud)
我使用这种方法将相机移动到特定位置,并在开始时正确移动相机。然后TrackballControls不起作用,控制台出现错误。
TrackballControls.js:318 Uncaught TypeError: _this.object.position.addVectors is not a function
at THREE.TrackballControls.update (TrackballControls.js:318)
at animate ((index):456)
Run Code Online (Sandbox Code Playgroud) Trackball works well in my three.js program along with onMouseClick and onMouseUp event listeners. I enable Trackball using the line:-
controls = new THREE.TrackballControls( scene01camera02 , DOM_container);
Run Code Online (Sandbox Code Playgroud)
But the onMouseDown event listener does not work.
If I disable trackball (by commenting out the line of code shown above) and disable any other related code then onMouseDown works fine.
Is there some way to use both onMouseDown and Trackball control at the same time?
The reason is so that when a …
我正在尝试进行由许多线组成的模拟.到目前为止,我有了Three.js v45和Trackball Controls,它运行良好.
然后我尝试在缓冲区几何中实现我的线条(如下例所示:http://fzwoch.project-sheol.org/three.js/examples/webgl_buffergeometry_lines.html)
但为此,我需要更新到更新的Three.js版本.并且轨迹球控制不再起作用了!我错过了什么吗?我怎样才能让两者都起作用?
谢谢Kasia