如何从onTouch获得三星手写笔按钮事件?

时间:2014-06-16 05:12:40

标签: android samsung-mobile

我的onTouch监听器中没有从三星S-Pen获得手写笔按钮事件。一切都在onHover上工作正常。

hoverListener = new View.OnHoverListener() {    
    public boolean onHover(View v, MotionEvent event) {
        Log.i("TEST", "tooltype = " + event.getToolType(0) + ", button = " + event.getButtonState());
        return false;
      }
    };

touchListener = new View.OnTouchListener() {    
    public boolean onTouch(View v, MotionEvent event) {
        Log.i("TEST", "tooltype = " + event.getToolType(0) + ", button = " + event.getButtonState());
        return false;
      }
    };

    backgroundView.setOnTouchListener(touchListener);
    backgroundView.setOnHoverListener(hoverListener);

0 个答案:

没有答案