diff --git a/app/qml/mousepad.qml b/app/qml/mousepad.qml index 627c0ab75..22731addb 100644 --- a/app/qml/mousepad.qml +++ b/app/qml/mousepad.qml @@ -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}); } } } diff --git a/plugins/remotecontrol/remotecontrolplugin.cpp b/plugins/remotecontrol/remotecontrolplugin.cpp index e2bf60c00..ae8e0cf1a 100644 --- a/plugins/remotecontrol/remotecontrolplugin.cpp +++ b/plugins/remotecontrol/remotecontrolplugin.cpp @@ -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); } diff --git a/plugins/remotecontrol/remotecontrolplugin.h b/plugins/remotecontrol/remotecontrolplugin.h index e6ea34387..bb41175bf 100644 --- a/plugins/remotecontrol/remotecontrolplugin.h +++ b/plugins/remotecontrol/remotecontrolplugin.h @@ -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