Search in sources :

Example 46 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class MousePadPlugin method sendScroll.

public void sendScroll(float dx, float dy) {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_MOUSEPAD_REQUEST);
    np.set("scroll", true);
    np.set("dx", dx);
    np.set("dy", dy);
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 47 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class MousePadPlugin method sendMouseDelta.

public void sendMouseDelta(float dx, float dy) {
    NetworkPacket np = device.getAndRemoveUnsentPacket(NetworkPacket.PACKET_REPLACEID_MOUSEMOVE);
    if (np == null) {
        np = new NetworkPacket(PACKET_TYPE_MOUSEPAD_REQUEST);
    } else {
        dx += np.getInt("dx");
        dy += np.getInt("dx");
    }
    np.set("dx", dx);
    np.set("dy", dy);
    device.sendPacket(np, NetworkPacket.PACKET_REPLACEID_MOUSEMOVE);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 48 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class KeyListenerView method sendChars.

public void sendChars(CharSequence chars) {
    final NetworkPacket np = new NetworkPacket(MousePadPlugin.PACKET_TYPE_MOUSEPAD_REQUEST);
    np.set("key", chars.toString());
    sendKeyPressPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 49 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class BigscreenPlugin method sendLeft.

public void sendLeft() {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_MOUSEPAD_REQUEST);
    np.set("specialKey", SpecialKeysMap.get(KeyEvent.KEYCODE_DPAD_LEFT));
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 50 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class BigscreenPlugin method sendDown.

public void sendDown() {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_MOUSEPAD_REQUEST);
    np.set("specialKey", SpecialKeysMap.get(KeyEvent.KEYCODE_DPAD_DOWN));
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Aggregations

NetworkPacket (org.kde.kdeconnect.NetworkPacket)77 IOException (java.io.IOException)6 SSLSocket (javax.net.ssl.SSLSocket)4 SMSHelper (org.kde.kdeconnect.Helpers.SMSHelper)4 BufferedReader (java.io.BufferedReader)3 InputStreamReader (java.io.InputStreamReader)3 ServerSocket (java.net.ServerSocket)3 Socket (java.net.Socket)3 SocketException (java.net.SocketException)3 ArrayList (java.util.ArrayList)3 Timer (java.util.Timer)3 SuppressLint (android.annotation.SuppressLint)2 Uri (android.net.Uri)2 SmsMessage (android.telephony.SmsMessage)2 SpannableString (android.text.SpannableString)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2 DatagramSocket (java.net.DatagramSocket)2 InetAddress (java.net.InetAddress)2 InetSocketAddress (java.net.InetSocketAddress)2