gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
660 stars 59 forks source link

Feature Request: Make the Windows/Meta key usable in key combos #116

Closed kriba24 closed 1 year ago

kriba24 commented 1 year ago

I appreciate the addition of the Windows/Meta key. I think it would be beneficial if the key could be used to send keyboard shortcuts, e.g. Windows+L, etc

gujjwal00 commented 1 year ago

Yes, that would be beneficial.

To be honest, I originally implemented these virtual keys to be very simple. I thought if someone wants full PC experience, they will use something like Hacker's Keyboard. But people seems to like these.

Related #99 & #117

nahuhh commented 1 year ago

@gujjwal00

Using avnc + AnySoftKeyboard doesnt register the Ctrl button. This might be a bug (?), but if not, it might be why myself and others rely on the extra keys row in avnc.

Iey4iej3 commented 1 year ago

It might be possible that Android intercepts these keys.

gujjwal00 commented 1 year ago

I have changed the 'Super' key back to a toggle button, so the primary issue about key combos should be fixed.

Using avnc + AnySoftKeyboard doesnt register the Ctrl button.

I tried AnySoftKeyboard, and unfortunately it does not generate key-events correctly for Ctrl (possibly other meta keys too). Here is an example of generated events:

Key test

```python KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_CTRL_LEFT, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=0 } KeyEvent { action=ACTION_UP, keyCode=KEYCODE_CTRL_LEFT, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=0 } KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_A, scanCode=0, metaState=META_CTRL_ON|META_CTRL_LEFT_ON|META_CTRL_RIGHT_ON, flags=0x0, repeatCount=0, eventTime=1673859708560, downTime=1673859708560, deviceId=-1, source=0x0, displayId=0 } KeyEvent { action=ACTION_UP, keyCode=KEYCODE_A, scanCode=0, metaState=META_CTRL_ON|META_CTRL_LEFT_ON|META_CTRL_RIGHT_ON, flags=0x0, repeatCount=0, eventTime=1673859708560, downTime=1673859708560, deviceId=-1, source=0x0, displayId=0 } Preview text: ```

Events are generated in this order: ctrl-down -> ctrl-up -> a-down -> a-up But it should be: ctrl-down -> a-down -> a-up -> ctrl-up or ctrl-down -> a-down -> ctrl-up -> a-up

nahuhh commented 1 year ago

@gujjwal00 Youre right.

"Unexpected keyboard" works

gujjwal00 commented 1 year ago

Commit: https://github.com/gujjwal00/avnc/commit/24d7e760baf79f72559058b7dc0d22a2d6c2e714