Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KDE Connect
Commits
6c4ba396
Commit
6c4ba396
authored
Jul 13, 2021
by
Piyush Aggarwal
🎮
Browse files
remotecontrolplugin: change sendCommand function params to allow support for scroll
parent
67129532
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/qml/mousepad.qml
View file @
6c4ba396
...
...
@@ -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
}
);
}
}
}
...
...
plugins/remotecontrol/remotecontrolplugin.cpp
View file @
6c4ba396
...
...
@@ -35,9 +35,9 @@ void RemoteControlPlugin::moveCursor(const QPoint &p)
sendPacket
(
np
);
}
void
RemoteControlPlugin
::
sendCommand
(
const
Q
String
&
name
,
bool
val
)
void
RemoteControlPlugin
::
sendCommand
(
const
Q
JsonObject
&
body
)
{
NetworkPacket
np
(
PACKET_TYPE_MOUSEPAD_REQUEST
,
{{
name
,
val
}}
);
NetworkPacket
np
(
PACKET_TYPE_MOUSEPAD_REQUEST
,
body
.
toVariantMap
()
);
sendPacket
(
np
);
}
...
...
plugins/remotecontrol/remotecontrolplugin.h
View file @
6c4ba396
...
...
@@ -28,7 +28,7 @@ public:
QString
dbusPath
()
const
override
;
Q_SCRIPTABLE
void
moveCursor
(
const
QPoint
&
p
);
Q_SCRIPTABLE
void
sendCommand
(
const
Q
String
&
name
,
bool
val
);
Q_SCRIPTABLE
void
sendCommand
(
const
Q
JsonObject
&
body
);
};
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment