GSConnect / gnome-shell-extension-gsconnect

KDE Connect implementation for GNOME
GNU General Public License v2.0
3.18k stars 254 forks source link

Keyboard input dialog does not accept compose sequences #1572

Open billybhaub opened 1 year ago

billybhaub commented 1 year ago

Describe the bug

Whenever I use GSConnect's keyboard to write french text on my phone, the accented characters that require a combination of keypresses (like à and è, but not "é" which is a single keypress) are not sent to the phone.

In the support log, I sent these three characters, in order : "e", "è" and "é". As you can see, there's a clear issue with "è"!

Steps to reproduce

  1. set yourself to use the virtual keyboard.
  2. set your keyboard to "French (Canada)"
  3. try to send accented characters that require two keypresses, like "à" and "è".

Expected behavior

These characters should be sent to the phone, since the both GSConnect and the phone can handle accented characters, which is proven by the fact that the single key "é" is recognized.

GSConnect version

50

Installed from

OS package manager

GNOME Shell version

42.5

Linux distribution/release

Ubuntu 22.04.1 LTS

Paired device(s)

Samsung S21 ULTRA

KDE Connect app version

1.22.1

Plugin(s)

keyboard

Support log

GSConnect: 50 (system)
GJS:       17202
Session:   wayland
OS:        Ubuntu 22.04.1 LTS
--------------------------------------------------------------------------------
Feb 26 10:35:43 wpa_supplicant[749]: wlo1: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-76 noise=9999 txrate=180000
Feb 26 10:35:54 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/ui/mousepad.js:vfunc_key_press_event:187]: "keyval: 101, mask: 0"
Feb 26 10:35:54 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/device.js:sendPacket:449]: SM-G998W: {
                                                              "id": 1677425754650,
                                                              "type": "kdeconnect.mousepad.request",
                                                              "body": {
                                                                "alt": false,
                                                                "ctrl": false,
                                                                "shift": false,
                                                                "super": false,
                                                                "sendAck": true,
                                                                "key": "e"
                                                              }
                                                            }
Feb 26 10:35:54 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/device.js:_readLoop:341]: SM-G998W: {
                                                              "id": 1677425754933,
                                                              "type": "kdeconnect.mousepad.echo",
                                                              "body": {
                                                                "key": "e",
                                                                "shift": false,
                                                                "ctrl": false,
                                                                "alt": false,
                                                                "isAck": true
                                                              }
                                                            }
Feb 26 10:35:54 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/plugins/mousepad.js:_handleEcho:244]: SM-G998W: this._dialog.text is undefined
                                                            _handleEcho@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/plugins/mousepad.js:244:13
                                                            handlePacket@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/plugins/mousepad.js:137:22
                                                            handlePacket@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:418:25
                                                            _readLoop@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:342:22
                                                            async*setChannel@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:323:18
                                                            _onChannel@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/manager.js:225:20
                                                            channel@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/core.js:448:19
                                                            _onIdentity@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/backends/lan.js:380:18
                                                            async*_onIncomingIdentity@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/backends/lan.js:325:18
                                                            @/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:727:17
Feb 26 10:35:57 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/ui/mousepad.js:vfunc_key_press_event:187]: "keyval: 233, mask: 0"
Feb 26 10:35:57 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/device.js:sendPacket:449]: SM-G998W: {
                                                              "id": 1677425757256,
                                                              "type": "kdeconnect.mousepad.request",
                                                              "body": {
                                                                "alt": false,
                                                                "ctrl": false,
                                                                "shift": false,
                                                                "super": false,
                                                                "sendAck": true,
                                                                "key": "é"
                                                              }
                                                            }
Feb 26 10:35:57 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/device.js:_readLoop:341]: SM-G998W: {
                                                              "id": 1677425757547,
                                                              "type": "kdeconnect.mousepad.echo",
                                                              "body": {
                                                                "key": "é",
                                                                "shift": false,
                                                                "ctrl": false,
                                                                "alt": false,
                                                                "isAck": true
                                                              }
                                                            }
Feb 26 10:35:57 org.gnome.Shell.Extensions.GSConnect[1815]: [/service/plugins/mousepad.js:_handleEcho:244]: SM-G998W: this._dialog.text is undefined
                                                            _handleEcho@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/plugins/mousepad.js:244:13
                                                            handlePacket@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/plugins/mousepad.js:137:22
                                                            handlePacket@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:418:25
                                                            _readLoop@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:342:22
                                                            async*setChannel@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:323:18
                                                            _onChannel@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/manager.js:225:20
                                                            channel@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/core.js:448:19
                                                            _onIdentity@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/backends/lan.js:380:18
                                                            async*_onIncomingIdentity@/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/backends/lan.js:325:18
                                                            @/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:727:17

Screenshots

No response

Notes

No response

daniellandau commented 1 year ago

So is the è not going through at all, or what is the issue? I tried with all sorts of different keyboard layouts and the characters seem to go through, but whenever I press Alt Gr to initiate a dead key a NUL character is sent, which is not ideal. The correct character is sent next though.

Which exact keyboard layout are you using? The closest to "Canadian Multilingual" I could find was "Canadian (intl., 1st part)", which is -layout ca -variant multi in XKB

billybhaub commented 1 year ago

The "è" is not going through at all. I'm using "French (canadian)" layout. I'll edit the issue with the right information for the keyboard. Screenshot from 2023-02-27 07-29-52

andyholmes commented 1 year ago

I think the dialog probably doesn't support composing characters.

[/service/ui/mousepad.js:vfunc_key_press_event:187]: "keyval: 101, mask: 0"

Here you can see we're actually reading the keysym; the symbol associated with the keycode that keyboard produces. This was done so we can grab non-printable characters (e.g. Esc) as well as modifiers (e.g. Ctrl). I think to support the key combinations for composition would need another UI page.