gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
674 stars 60 forks source link

Problem with capital letters and other characters AVNC Android virtual keyboard #269

Open 12elotro opened 1 week ago

12elotro commented 1 week ago

Problem with capital letters and other characters AVNC Android virtual keyboard

Hello, I have "X11VNC Server" installed on Linux Mint 22

The configuration file is:

ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -nomodtweak -rfbauth /home/.vnc/passwd -rfbport 5900 -shared

If I connect through the Remmina application installed on another Linux Mint, I have no problem with the exchange of lowercase/uppercase letters or other special characters.

With the AVNC Android application, when checking the keyboard in Settings/Tools/Key test, there is no problem exchanging lowercase/uppercase letters and typing special characters like @ # €

But when I connect to my Linux Mint computer with the AVNC Android application, and I have problems with the keyboard, even if I select uppercase on the virtual keyboard, I write in lowercase, the exchange between lowercase/uppercase on the virtual keyboard has no effect on Linux Mint, either. I can enter special characters like @ # € even if I type them on the virtual keyboard. The only way to enter a capital letter is by activating the "SHIFT" button and then the letter, but it is uncomfortable, because the SHIFT is deactivated when typing a letter

gujjwal00 commented 1 week ago

Which virtual keyboard app are you using?

Also, please open Key test again, enter few uppercase, lowercase and special characters. Copy the logs and paste here.

12elotro commented 1 week ago

I'm using Gboard on Pixel 8, Android 15

I have tried the Microsoft SwiftKey keyboard and the capitalization problem disappears, but I still have problems with some special characters.

In Settings/Tools/Key Test/, with Gboard keyboard, I have typed the following: h H @#€HHHHH

In the test it sends everything correctly but when sending Linux Mint to the X11VNC server, it sends everything in lower case and none of the special characters

Copy Logs Settings/Tools/Key Tets

<details>
<summary>Key test</summary>
<p>

```python
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64523928000000, downTime=64523928000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64523928000000, downTime=64523928000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_SPACE, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64524239000000, downTime=64524239000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_SPACE, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64524239000000, downTime=64524239000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=META_SHIFT_ON|META_SHIFT_LEFT_ON, flags=0x6, repeatCount=0, eventTime=64524990000000, downTime=64524990000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64524991000000, downTime=64524990000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64525692000000, downTime=64525692000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64525692000000, downTime=64525692000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_SPACE, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64530504000000, downTime=64530504000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_SPACE, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64530504000000, downTime=64530504000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_AT, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64535956000000, downTime=64535956000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_AT, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64535956000000, downTime=64535956000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_POUND, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64536839000000, downTime=64536839000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_POUND, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64536839000000, downTime=64536839000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_MULTIPLE, keyCode=KEYCODE_UNKNOWN, scanCode=0, characters="€", metaState=0, flags=0x0, repeatCount=0, eventTime=64537253000000, downTime=64537253000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=META_SHIFT_ON|META_SHIFT_LEFT_ON, flags=0x6, repeatCount=0, eventTime=64539333000000, downTime=64539333000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64539333000000, downTime=64539333000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=META_SHIFT_ON|META_SHIFT_LEFT_ON, flags=0x6, repeatCount=0, eventTime=64539710000000, downTime=64539710000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64539710000000, downTime=64539710000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=META_SHIFT_ON|META_SHIFT_LEFT_ON, flags=0x6, repeatCount=0, eventTime=64540066000000, downTime=64540066000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_SHIFT_LEFT, scanCode=0, metaState=0, flags=0x6, repeatCount=0, eventTime=64540066000000, downTime=64540066000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64540865000000, downTime=64540865000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64540865000000, downTime=64540865000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541199000000, downTime=64541199000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541200000000, downTime=64541199000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541295000000, downTime=64541295000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541295000000, downTime=64541295000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541386000000, downTime=64541386000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541386000000, downTime=64541386000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541511000000, downTime=64541511000000, deviceId=-1, source=0x101, displayId=-1 }
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_H, scanCode=0, metaState=META_SHIFT_ON, flags=0x6, repeatCount=0, eventTime=64541511000000, downTime=64541511000000, deviceId=-1, source=0x101, displayId=-1 }

Preview text: h H @#€HHHHH

Preview text: h H @#€HHHHH

Preview text: h H @#€HHHHH

12elotro commented 6 days ago

any suggestions?

gujjwal00 commented 6 days ago

The root cause is that the keyboard is not generating events correctly:

I have a possible workaround for capital letters, just need to make sure it doesn't break anything else.

So my advice for now is to try a different keyboard app, and if possible, give TigerVNC server a try.

gujjwal00 commented 6 days ago

In the test it sends everything correctly

The test uses a native TextBox, which has access to full key event, specifically meta key state, so it can infer the correct character. Passing events through VNC protocol is more error prone.