Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package com.zhanglei.mobilemouse;
package com.sreejuzzz.mobilemouse;


/**
* Created by SreejuZzz on 27022018
*/


import android.app.Activity;
import android.os.Bundle;
Expand Down Expand Up @@ -101,14 +107,14 @@ public boolean onKey(View v, int keyCode, KeyEvent event) {
boardInput.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
Log.i("fuck", "before: " + s);
Log.i("ooii", "before: " + s);
mLastInput = s.toString();
}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (s.length()==0) return;
Log.i("fuck", "on: " + s + ", last char: " + s.toString().substring(s.length() - 1));
Log.i("ooii", "on: " + s + ", last char: " + s.toString().substring(s.length() - 1));
String lastChar = s.subSequence(s.length() - 1, s.length()).toString();
if (!TextUtils.isEmpty(lastChar) && s.length() > mLastInput.length()) {
sendCommand(OperationData.OPERATION_TYPE_TEXT, 0, 0, lastChar);
Expand All @@ -118,7 +124,7 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {

@Override
public void afterTextChanged(Editable s) {
Log.i("fuck", "after: " + s.toString());
Log.i("ooii", "after: " + s.toString());
}
});

Expand Down Expand Up @@ -234,7 +240,7 @@ private void sendCommand(int operationKind, int x, int y, String input) {
if (x!=0) operation.setMoveX(x);
if (y!=0) operation.setMoveY(y);
if (input!=null) operation.setInputStr(input);
Log.i("fuck", "" + operation);
Log.i("ooii", "" + operation);
msg.obj = CommandParser.parseCommand(operation);
msg.sendToTarget();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package com.zhanglei.mobilemouse;
package com.sreejuzzz.mobilemouse;


/**
* Created by SreejuZzz on 27022018
*/


import android.app.Activity;
import android.content.Intent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package com.zhanglei.mobilemouse.networkutil;
package com.sreejuzzz.mobilemouse.networkutil;


/**
* Created by SreejuZzz on 27022018
*/


import android.os.Handler;
import android.os.Looper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package com.zhanglei.mobilemouse.networkutil;
package com.sreejuzzz.mobilemouse.networkutil;


/**
* Created by SreejuZzz on 27022018
*/


import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.zhanglei.mobilemouse.operation;
package com.sreejuzzz.mobilemouse.operation;

import com.google.gson.Gson;

/**
* Created by zhanglei on 15/7/3.
* Created by SreejuZzz on 27022018
*/

public class CommandParser {

public static String parseCommand(OperationData operation) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.zhanglei.mobilemouse.operation;
package com.sreejuzzz.mobilemouse.operation;

/**
* Created by zhanglei on 15/7/2.
* Created by SreejuZzz on 27022018
*/

public class OperationData {
public static final int OPERATION_MOVE = 0;
public static final int OPERATION_CLICK_DOWN = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package com.zhanglei.mobilemouse.main;
package com.sreejuzzz.mobilemouse.operation;

/**
* Created by SreejuZzz on 27022018
*/


import com.zhanglei.mobilemouse.networkutil.CommandReceiver;
Expand All @@ -7,6 +11,7 @@
import com.zhanglei.mobilemouse.operation.OperationDecode;
import com.zhanglei.mobilemouse.utils.MouseUtil;


public class MyServer {
private static final float MOVE_RATIO = 0.2f;
public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package com.zhanglei.mobilemouse.networkutil;
package com.sreejuzzz.mobilemouse.networkutil;

/**
* Created by SreejuZzz on 27022018
*/

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;



public class CommandReceiver extends Thread {
public static final int PORT = 9898;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.zhanglei.mobilemouse.operation;
package com.sreejuzzz.mobilemouse.operation;

/**
* Created by zhanglei on 15/7/2.
* Created by SreejuZzz on 27022018
*/
public class OperationData {
public static final int OPERATION_MOVE = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
package com.zhanglei.mobilemouse.operation;
package com.sreejuzzz.mobilemouse.operation;

/**
* Created by SreejuZzz on 27022018
*/


import com.google.gson.Gson;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
package com.zhanglei.mobilemouse.utils;
package com.sreejuzzz.mobilemouse.utils;

/**
* Created by SreejuZzz on 27022018
*/


import java.awt.event.KeyEvent;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
package com.zhanglei.mobilemouse.utils;
package com.sreejuzzz.mobilemouse.utils;

/**
* Created by SreejuZzz on 27022018
*/


import java.awt.AWTException;
import java.awt.Robot;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package com.zhanglei.mobilemouse.utils;
package com.sreejuzzz.mobilemouse.utils;


/**
* Created by SreejuZzz on 27022018
*/


import java.awt.AWTException;
import java.awt.Dimension;
Expand Down