title: onGenericMotionEvent on android button
body: <p>I did not able to set the <code>onGenericMotionEvent</code> on the button or any view. Means I did not get any response from <code>onGenericMotionEvent</code> method.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>&lt;Button
                  android:id="@+id/btnMouse"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p>my Java file coding:</p>
  
  <pre><code> @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_remote_controls);
  btn1 = (Button) findViewById(R.id.btnMouse);
  }
  
  @Override
  public boolean onGenericMotionEvent(MotionEvent event) {
      int pointerCount = event.getPointerCount();
  
      switch (event.getAction() &amp; event.ACTION_MASK) {
          case MotionEvent.ACTION_POINTER_DOWN:
              Log.e("Mouse: ", "Right Click");
              return true;
          case MotionEvent.ACTION_DOWN:
              Log.w("Mouse: ", "Left Click");
              return true;
          case MotionEvent.ACTION_HOVER_MOVE:
              if (pointerCount == 1) {
                  Log.e("Mouse: ", "Move");
              } else if (pointerCount == 2) {
                  Log.e("Mouse: ", "Scroll");
              }
              return true;
      }
      return false;
  }
  </code></pre>
  
  <p>and when i use <code>setOnTouchListener</code> on button it works perfect, but i unable to get the <code>MotionEvent.ACTION_HOVER_MOVE</code> on my button, When i read documents it specify that <code>setOnTouchListener</code> can not handle <code>MotionEvent.ACTION_HOVER_MOVE</code> so that's why i want to use the <code>onGenericMotionEvent</code> on my button to get <code>MotionEvent.ACTION_HOVER_MOVE</code> action.</p>
  
  <p>or any other way to implements <code>MotionEvent.ACTION_HOVER_MOVE</code> on the button? </p>
  
  <p>But i don't know how can do that, please help</p>
  
  <p><strong>EDITED</strong></p>
  
  <p>By Android Button, I want to simulate the real mouse, Means when user dragged over it than i want to move my laptop mouse. </p>
  
  <p>When i use <code>MotionEvent.ACTION_MOVE:</code> it works and it move the my laptop mouse, but before my mouse move it change the location of laptop mouse pointer where it is click on button, so ignoring that Android provide <code>ACTION_HOVER_MOVE</code> it is not perform <code>ACTION_DOWN</code> unlike <code>ACTION_MOVE</code></p>