isontheline / pro.webssh.net

iOS / iPadOS / macOS SSH Client
https://apps.apple.com/us/app/id497714887
MIT License
316 stars 46 forks source link

Space key doesn't work with Full Keyboard Access #985

Closed melvinchia closed 1 year ago

melvinchia commented 1 year ago

Bug description

Space key on Magic Keyboard + iPad Pro (11", M2, 2022) on iPadOS 17.0.2 not working normally

Steps to reproduce

  1. Mount iPad Pro on Magic Keyboard
  2. Test if Space key in other apps - Tested working normally
  3. Launch WebSSH app and connect to server
  4. Type commands requiring space, Space key is not transmitted to remote server
  5. Tried working-around the problem, typing Option+Space seems to transmit a "space" to the remote server, but results in "Command not found" (somehow the "space" transmitted is not really space)
  6. Unmount iPad Pro from Magic Keyboard and enable virtual keyboard
  7. Type commands requiring space, Space key works normally

Summary

The Space key on the Magic Keyboard works normally in other apps. However, it seems to be broken in WebSSH when connected to remote servers. It worked fine on the same servers on iPadOS 16.

Did something break, or is it just me?

isontheline commented 1 year ago

Hello @melvinchia 👋

Many thanks for your feedback 🙏

Could you try this guide please? https://webssh.net/documentation/help/errors/magic-keyboard-space-bar-issue/

Have a nice day ☀️

melvinchia commented 1 year ago

hi @isontheline , thanks! I'll check if the Full Keyboard Access option is enabled..

Any idea why this happens only in this app, and not in others? And why it was working fine in iOS 16, but seems to have broken after the iOS 17 upgrade?

isontheline commented 1 year ago

No idea if it's related to the Full Keyboard Access but yes it feels that WebSSH can't handle it accordingly.

Could you ping me if you have been able to fix this issue?

melvinchia commented 1 year ago

Interestingly, with Full Keyboard Access on, I was able to type Space everywhere within the UI of WebSSH, but not within a remote ssh session window. Turning Full Keyboard Access off, I was able to type Space within the remote ssh session window.

This probably means it might be something inside the remote ssh session window that's blocking the Space.

isontheline commented 1 year ago

There are several users reporting issues (outside WebSSH) like :

https://discussions.apple.com/thread/253525520

I will try to find if I can fix on my side these behaviors

melvinchia commented 1 year ago

Ahhh.. that gave some insight to why it isn't working.. I went in to check (Accessibility -> Keyboards -> Full Keyboard Access -> Commands) and found that Space is assigned to INTERACTION -> Activate.

I'm guessing Full Keyboard Access should be turned off (default) most of the time for "normal use" cases, and only turned on if I really need the keyboard to trigger those commands in that panel.

Probably to mitigate the time that FCA is turned on, you could add a detection within ssh session windows for the "Activate" interaction and output a Space instead? I'm not sure if the "Activate" interaction does anything else good, but that probably also explains why pressing the Space triggers the ssh session window activation (a border appears around the window).

isontheline commented 1 year ago

Yes you're right @melvinchia I will try to catch the "Activate" interaction.

I'm reopening this issue and hope to found a fix soon.

Thank you so much for your strong feedback!

isontheline commented 1 year ago

I can't find a fix as the app didn't receive any event when FKA is enabled.

I'm sorry 😓

melvinchia commented 1 year ago

hmmm.. does your app have the ability to detect if FKA is enabled? if so, maybe it can detect, and display a modal window telling the user to disable FKA?

isontheline commented 1 year ago

As of my last knowledge, there's no direct API in iOS to detect whether "Full Keyboard Access" is enabled on a device. "Full Keyboard Access" is a user setting that determines whether a keyboard or a pointing device can be used to navigate the user interface.

I think only Voice Over could be checked if enabled.

melvinchia commented 1 year ago

sigh.. unfortunately that seems to be true.. the isfullkeyboardaccessenabled seems to be only for MacOS.. maybe we can put in a request to Apple to extend it to iOS/iPadOS as well..

https://developer.apple.com/documentation/appkit/nsapplication/1428469-isfullkeyboardaccessenabled

isontheline commented 1 year ago

You're right it's only on macOS and it's not even on Mac Catalyst (needed for WebSSH to be cross platform)

I would like to improve WebSSH as the FKA is a great feature but my input implementation seems to be broken