2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Renaming a package type was a bad call

This commit is contained in:
Albert Vaca
2016-06-03 00:46:18 +02:00
parent e433ad8bce
commit 3f20af445a
3 changed files with 14 additions and 14 deletions

View File

@@ -918,12 +918,12 @@ public class Device implements BaseLink.PackageReceiver {
public void hackToMakeRetrocompatiblePacketTypes(NetworkPackage np) {
if (protocolVersion >= 6) return;
np.mType = np.getType().replace(".request","").replace(".input",".mousepad");
np.mType = np.getType().replace(".request","");
}
public String hackToMakeRetrocompatiblePacketTypes(String type) {
if (protocolVersion >= 6) return type;
return type.replace(".request","").replace(".input",".mousepad");
return type.replace(".request","");
}
}

View File

@@ -101,7 +101,7 @@ public class KeyListenerView extends View {
}
public void sendChars(CharSequence chars) {
final NetworkPackage np = new NetworkPackage(MousePadPlugin.PACKAGE_TYPE_INPUT_REQUEST);
final NetworkPackage np = new NetworkPackage(MousePadPlugin.PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("key", chars.toString());
sendKeyPressPackage(np);
}
@@ -135,7 +135,7 @@ public class KeyListenerView extends View {
//Log.e("KeyDown", "utfChar:" + (char)event.getUnicodeChar());
//Log.e("KeyDown", "intUtfChar:" + event.getUnicodeChar());
final NetworkPackage np = new NetworkPackage(MousePadPlugin.PACKAGE_TYPE_INPUT_REQUEST);
final NetworkPackage np = new NetworkPackage(MousePadPlugin.PACKAGE_TYPE_MOUSEPAD_REQUEST);
boolean modifier = false;
if (event.isAltPressed()) {

View File

@@ -31,8 +31,8 @@ import org.kde.kdeconnect_tp.R;
public class MousePadPlugin extends Plugin {
//public final static String PACKAGE_TYPE_INPUT = "kdeconnect.input";
public final static String PACKAGE_TYPE_INPUT_REQUEST = "kdeconnect.input.request";
//public final static String PACKAGE_TYPE_MOUSEPAD = "kdeconnect.mousepad";
public final static String PACKAGE_TYPE_MOUSEPAD_REQUEST = "kdeconnect.mousepad.request";
@Override
public String getDisplayName() {
@@ -73,7 +73,7 @@ public class MousePadPlugin extends Plugin {
@Override
public String[] getOutgoingPackageTypes() {
return new String[]{PACKAGE_TYPE_INPUT_REQUEST};
return new String[]{PACKAGE_TYPE_MOUSEPAD_REQUEST};
}
@Override
@@ -82,7 +82,7 @@ public class MousePadPlugin extends Plugin {
}
public void sendMouseDelta(float dx, float dy, float sensitivity) {
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("dx", dx*sensitivity);
np.set("dy", dy*sensitivity);
@@ -91,37 +91,37 @@ public class MousePadPlugin extends Plugin {
}
public void sendSingleClick() {
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("singleclick", true);
device.sendPackage(np);
}
public void sendDoubleClick() {
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("doubleclick", true);
device.sendPackage(np);
}
public void sendMiddleClick() {
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("middleclick", true);
device.sendPackage(np);
}
public void sendRightClick() {
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("rightclick", true);
device.sendPackage(np);
}
public void sendSingleHold(){
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("singlehold", true);
device.sendPackage(np);
}
public void sendScroll(float dx, float dy) {
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_INPUT_REQUEST);
NetworkPackage np = new NetworkPackage(PACKAGE_TYPE_MOUSEPAD_REQUEST);
np.set("scroll", true);
np.set("dx", dx);
np.set("dy", dy);