Extract RemoteKeyboard.qml into declarativeplugin to be able to use it from both plasmoid and app without code duplication
Details
- Reviewers
hkaelberer apol - Group Reviewers
KDE Connect - Commits
- R224:952da637b037: Share RemoteKeyboard implementation
Diff Detail
- Repository
- R224 KDE Connect
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
By removing this code you change behaviour: The initial idea was to not make the TextField echo immediately what has been typed, but visualize on desktop what the remote device acked via a network package. This allows for a kind of realtime confirmation of what the remote device *really* processed. Therefore the original event was not accepted and injected artificially onAckPackageReceived. This has some shortcomings, as the echoing in the TextField is incomplete with respect to the handled special keys etc.
A more complete discussion can be found in the original RR: https://git.reviewboard.kde.org/r/129727/
If one wants to keep this behaviour, IMHO the optimal solution would be to inject a real QKeyEvent to the TextField on reception of the ack-package. I played around with a thin native wrapper around QCoreApplication::postEvent() but did not succeed.
It is a design decision whether you want to stick to this echo-behaviour or simply echo immediately what was typed (what you propose here). Personally I would not have a problem with changing it, as in my everyday usage I noted that I always look on my phone when typing remotely via remotekeyboard.
I think that's a good idea to keep, especially if we want to support moving the cursor on the desktop in response to the same on the client (in the future).
I'd change the title to "Share RemoteKeyboard implementation". This is not what self-contained means ^^'.