Android Open Source - BluetoothHidEmu Hid Pointer Payload






From Project

Back to project page BluetoothHidEmu.

License

The source code is released under:

Apache License

If you think the Android project BluetoothHidEmu listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package andraus.bluetoothhidemu.sock.payload;
/*w ww.j  a v  a 2 s. co m*/
/**
 * 
 * @author andraus
 *
 */
public class HidPointerPayload extends HidPayload {
  
  private static final int SIZE = 6;
  private static final int REPORT_ID_POINTER = 0x02;
  
    public static final int MAX_POINTER_MOVE = 0x7f;
    
    public static final int MOUSE_BUTTON_NONE = 0x00;
    public static final int MOUSE_BUTTON_1 = 0x01; // bit 0
    public static final int MOUSE_BUTTON_2 = 0x02; // bit 1
    
  /**
   * 
   */
  public HidPointerPayload() {
    super(SIZE);
    
        mPayload[0] = (byte)0xa1;
        mPayload[1] = (byte)REPORT_ID_POINTER; // report_id (mouse)
        mPayload[2] = (byte)0x00;          // button
        mPayload[3] = (byte)0x00;         // x
        mPayload[4] = (byte)0x00;         // y
        mPayload[5] = (byte)0x00;              // wheel
  }
  
  /**
   * 
   * @param x
   * @param y
   */
  public void movePointer(int x, int y) {
    setByte(3, x);
    setByte(4, y);
  }
  
  /**
   * 
   */
  public void resetBytes() {
    setByte(2, MOUSE_BUTTON_NONE);
    movePointer(0x00, 0x00);
  }
  
  /**
   * 
   */
  public void clickButton(int button) {
      // enable bit
      setByte(2, mPayload[2] | button);
  }
  
  /**
   * 
   */
  public void releaseButton(int button) {
      // disable bit
      setByte(2, mPayload[2] ^ button);
  }

}




Java Source Code List

andraus.bluetoothhidemu.BluetoothHidEmuActivity.java
andraus.bluetoothhidemu.ButtonClickListener.java
andraus.bluetoothhidemu.Constants.java
andraus.bluetoothhidemu.KeyboardKeyListener.java
andraus.bluetoothhidemu.KeyboardTextWatcher.java
andraus.bluetoothhidemu.SpecialKeyListener.java
andraus.bluetoothhidemu.TouchpadListener.java
andraus.bluetoothhidemu.settings.BluetoothAdapterStateReceiver.java
andraus.bluetoothhidemu.settings.BluetoothDeviceStateReceiver.java
andraus.bluetoothhidemu.settings.Settings.java
andraus.bluetoothhidemu.sock.BluetoothSocketThread.java
andraus.bluetoothhidemu.sock.SocketManager.java
andraus.bluetoothhidemu.sock.payload.HidConsumerPayload.java
andraus.bluetoothhidemu.sock.payload.HidKeyPair.java
andraus.bluetoothhidemu.sock.payload.HidKeyboardPayload.java
andraus.bluetoothhidemu.sock.payload.HidPayload.java
andraus.bluetoothhidemu.sock.payload.HidPointerPayload.java
andraus.bluetoothhidemu.sock.payload.HidSixaxisPayload.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferFactory.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferGeneric.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferMotoReflect.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferMoto.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpoofer.java
andraus.bluetoothhidemu.spoof.CleanupExceptionHandler.java
andraus.bluetoothhidemu.spoof.Spoof.java
andraus.bluetoothhidemu.spoof.jni.BluetoothSocketJni.java
andraus.bluetoothhidemu.ui.GenericUiControls.java
andraus.bluetoothhidemu.ui.Ps3KeypadUiControls.java
andraus.bluetoothhidemu.ui.UiControls.java
andraus.bluetoothhidemu.util.DoLog.java
andraus.bluetoothhidemu.view.ArrowButton.java
andraus.bluetoothhidemu.view.BluetoothDeviceArrayAdapter.java
andraus.bluetoothhidemu.view.BluetoothDeviceView.java
andraus.bluetoothhidemu.view.EchoEditText.java
andraus.bluetoothhidemu.view.ViewUtils.java