| Summary: | Remote keyboard fail to enter Chinese characters | ||
|---|---|---|---|
| Product: | [Applications] kdeconnect | Reporter: | Harold Z <zhangzhigang1996> |
| Component: | common | Assignee: | Albert Vaca Cintora <albertvaka> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | andrew.g.r.holmes, chen73559 |
| Priority: | NOR | ||
| Version First Reported In: | 23.08.4 | ||
| Target Milestone: | --- | ||
| Platform: | Kubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Harold Z
2024-01-25 11:34:00 UTC
Add debug code:
diff --git a/plugins/mousepad/waylandremoteinput.cpp b/plugins/mousepad/waylandremoteinput.cpp
index eb10810b..e1e816ec 100644
--- a/plugins/mousepad/waylandremoteinput.cpp
+++ b/plugins/mousepad/waylandremoteinput.cpp
@@ -6,7 +6,7 @@
*/
#include "waylandremoteinput.h"
-
+#include <iostream>
#include <QDebug>
#include <QSizeF>
@@ -197,6 +197,10 @@ bool WaylandRemoteInput::handlePacket(const NetworkPacket &np)
const QString key = np.get<QString>(QStringLiteral("key"), QLatin1String(""));
const int specialKey = np.get<int>(QStringLiteral("specialKey"), 0);
+ if (!key.isEmpty()) {
+ std::cout << "key.toStdString:" << key.toStdString() << std::endl;
+ }
+
if (isSingleClick || isDoubleClick || isMiddleClick || isRightClick || isSingleHold || isSingleRelease || isScroll || !key.isEmpty() || specialKey) {
if (isSingleClick) {
s_session->iface->NotifyPointerButton(s_session->m_xdpPath, {}, BTN_LEFT, 1);
@@ -241,10 +245,13 @@ bool WaylandRemoteInput::handlePacket(const NetworkPacket &np)
} else if (!key.isEmpty()) {
for (const QChar character : key) {
const auto keysym = xkb_utf32_to_keysym(character.toLower().unicode());
+ std::cout << "zzg:xkb_utf32_to_keysym:[" << character.toLower().unicode() << "],[" << keysym << ']' << std::endl;
if (keysym != XKB_KEY_NoSymbol) {
+ std::cout << "zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]" << std::endl;
s_session->iface->NotifyKeyboardKeysym(s_session->m_xdpPath, {}, keysym, 1).waitForFinished();
s_session->iface->NotifyKeyboardKeysym(s_session->m_xdpPath, {}, keysym, 0).waitForFinished();
} else {
+ std::cout << "zzg:xkb_utf32_to_keysym:[Cannot send character]" << std::endl;
qCDebug(KDECONNECT_PLUGIN_MOUSEPAD) << "Cannot send character" << character;
}
}
log:
key.toStdString:hello
zzg:xkb_utf32_to_keysym:[104],[104]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[101],[101]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[108],[108]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[108],[108]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[111],[111]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
key.toStdString:你好
zzg:xkb_utf32_to_keysym:[20320],[16797536]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[22909],[16800125]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
key.toStdString:👌🏻
zzg:xkb_utf32_to_keysym:[55357],[16832573]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[56396],[16833612]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[55356],[16832572]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[57339],[16834555]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
key.toStdString:👌🏻👌🏻👌🏻
zzg:xkb_utf32_to_keysym:[55357],[16832573]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[56396],[16833612]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[55356],[16832572]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[57339],[16834555]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[55357],[16832573]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[56396],[16833612]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[55356],[16832572]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[57339],[16834555]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[55357],[16832573]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[56396],[16833612]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[55356],[16832572]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
zzg:xkb_utf32_to_keysym:[57339],[16834555]
zzg:xkb_utf32_to_keysym:[keysym != XKB_KEY_NoSymbol]
In xdg-desktop-portal-1.16.0, add debug code, Correct message can be received.
diff --git a/src/remote-desktop.c b/src/remote-desktop.c
index f450d69..104e502 100644
--- a/src/remote-desktop.c
+++ b/src/remote-desktop.c
@@ -17,7 +17,7 @@
*/
#include "config.h"
-
+#include <stdio.h>
#include "remote-desktop.h"
#include "screen-cast.h"
#include "request.h"
@@ -1141,6 +1141,7 @@ handle_notify_keyboard_keysym (XdpDbusRemoteDesktop *object,
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
options = g_variant_builder_end (&options_builder);
+ printf("xxxxxxxxxxxxxxxxxxxxxxxxxxxxx:keysym:[%d]\n", keysym);
xdp_dbus_impl_remote_desktop_call_notify_keyboard_keysym (impl,
session->id,
Using kdeconnect 23.0.8 on Windows 11, can input normally, and you can also use voice input on the mobile phone. The kde connect version used by Android phones is 1.29.0 The system uses the wayland protocol. (In reply to Harold Z from comment #3) > Using kdeconnect 23.0.8 on Windows 11, can input normally, and you can also > use voice input on the mobile phone. Do you mean inputting from windows to android? Using 23.8.4 on Windows 10, I tried inputing some chinese characters with Microsoft IME and Android side could not receive it Maybe the problem is rooted from the interaction with input method? On Windows kdeconnect coult not handle the strings from input method. (In reply to Alan from comment #6) > (In reply to Harold Z from comment #3) > > Using kdeconnect 23.0.8 on Windows 11, can input normally, and you can also > > use voice input on the mobile phone. > > Do you mean inputting from windows to android? Using 23.8.4 on Windows 10, I > tried inputing some chinese characters with Microsoft IME and Android side > could not receive it Sorry for not describing the problem clearly. I mean is inputting from android to Windows. |