// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static HashMap<String, Boolean> sConnectionAlive = new HashMap<>();
// 
// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static Client sSecuredClient;


import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import static project.android.ConnectionFragment.sConnectionAlive;
import static project.android.ConnectionFragment.sSecuredClient;
     * @param view the view that was clicked.
     */
    @Override
    public void onClick(View view) {
        String data = "";
        switch (view.getId()) {

            case R.id.button_touch_right:
                data = "right";
                break;

            case R.id.button_touch_middle:
                data = "middle";
                break;

            case R.id.touch_upscroll:
                data = "upscroll";
                break;

            case R.id.touch_downscroll:
                data = "downscroll";
        }
        sendMouseButtonData(data);
    }

    private void sendMouseButtonData(final String data) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                if (sConnectionAlive.containsValue(true)) {
// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static HashMap<String, Boolean> sConnectionAlive = new HashMap<>();
// 
// Path: app/src/main/java/project/android/ConnectionFragment.java
// public static Client sSecuredClient;


// Path: app/src/main/java/project/android/TouchpadFragment.java
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import static project.android.ConnectionFragment.sConnectionAlive;
import static project.android.ConnectionFragment.sSecuredClient;

     * @param view the view that was clicked.
     */
    @Override
    public void onClick(View view) {
        String data = "";
        switch (view.getId()) {

            case R.id.button_touch_right:
                data = "right";
                break;

            case R.id.button_touch_middle:
                data = "middle";
                break;

            case R.id.touch_upscroll:
                data = "upscroll";
                break;

            case R.id.touch_downscroll:
                data = "downscroll";
        }
        sendMouseButtonData(data);
    }

    private void sendMouseButtonData(final String data) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                if (sConnectionAlive.containsValue(true)) {
                    sSecuredClient.sendData("Mouse_Button", data);