Commit 6c4ba396 authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎮
Browse files

remotecontrolplugin: change sendCommand function params to allow support for scroll

parent 67129532
......@@ -30,7 +30,7 @@ Kirigami.Page
Layout.fillHeight: true
property var lastPos: Qt.point(-1, -1)
onClicked: mousepad.pluginInterface.sendCommand("singleclick", true);
onClicked: mousepad.pluginInterface.sendCommand({"singleclick": true});
onPositionChanged: {
if (lastPos.x > -1) {
......@@ -58,17 +58,17 @@ Kirigami.Page
Button {
Layout.fillWidth: true
icon.name: "input-mouse-click-left"
onClicked: mousepad.pluginInterface.sendCommand("singleclick", true);
onClicked: mousepad.pluginInterface.sendCommand({"singleclick": true});
}
Button {
Layout.fillWidth: true
icon.name: "input-mouse-click-middle"
onClicked: mousepad.pluginInterface.sendCommand("middleclick", true);
onClicked: mousepad.pluginInterface.sendCommand({"middleclick": true});
}
Button {
Layout.fillWidth: true
icon.name: "input-mouse-click-right"
onClicked: mousepad.pluginInterface.sendCommand("rightclick", true);
onClicked: mousepad.pluginInterface.sendCommand({"rightclick": true});
}
}
}
......
......@@ -35,9 +35,9 @@ void RemoteControlPlugin::moveCursor(const QPoint &p)
sendPacket(np);
}
void RemoteControlPlugin::sendCommand(const QString &name, bool val)
void RemoteControlPlugin::sendCommand(const QJsonObject& body)
{
NetworkPacket np(PACKET_TYPE_MOUSEPAD_REQUEST, {{name, val}});
NetworkPacket np(PACKET_TYPE_MOUSEPAD_REQUEST, body.toVariantMap());
sendPacket(np);
}
......
......@@ -28,7 +28,7 @@ public:
QString dbusPath() const override;
Q_SCRIPTABLE void moveCursor(const QPoint &p);
Q_SCRIPTABLE void sendCommand(const QString &name, bool val);
Q_SCRIPTABLE void sendCommand(const QJsonObject& body);
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment