The following limitations show up when running on < iOS 13
- Icons in accessory view are unavailable
- Dark mode is unavailable and colours default to light mode
- UIFont.monospacedSystemFont is unavailable so default font is "Menlo"
documentation recommends. Althought I have never seen one of these
events come with more than one key, nonetheless, it makes sense.
iOS: install a timer when a key is pressed, and starts 0.4 seconds
after the event, and repeats every 0.1 to get us auto-repeat
functionality. This values are hardcoded and match the values in the
Settings/Accessibility/Keyboard settings, as there does not seem to be
a way on iOS to retrieve these globals (on Mac, with AppKit, these are
constants in NSEvent).
Fix the build for Mac, by keeping the old #if os(iOS) around the section
that does the selection highlight.
Additionally, if we have no data to be sent, be a good iOS citizen and send the unhandled
event to our super as described in "Focus on iPad keyboard navigation" from WWDC 2021
SwiftTerm already has an inputAccessoryView that would provide a
handful of terminal commands that the iOS keyboard does not provide,
but lacked additional keys.
Now, it features a keyboard that can be displayed on demand that contains
helper keys, like function keys and other common keys.
Additionally, I introduced a darker color for some keys that do not
insert text, but have more editing capabilities, and it works on both
light and dark modes, and supports switching dynamically.
here, instead, took the space for the auxiliary keyboard input, which
is now requested from a client app - the only reason is that the
prototype I wrote uses SwiftUI, and I need a UIViewController to do
the view rehosting, and that is not possible on the library itself.
Maybe I could rewrite the keyboard with UIKit, but it just does not
seem remotely as fun.
iOSAccessoryView: the referece to the parent terminal and the
terminalView are now properly weak.
Moved extensions for the UIKit and AppKit into their separate files.
it behaves more like a text input control in iOS. A long-press will
add a "Select" option.
New selection markers are rendered, which can be used to adjust the
selection and these will scroll the view as well if they are near the
edge.
fuzzyHasSelectionBackground: Fixes the selection rendering on iOS, the
logic to return always true was wrong, it has to be true in one case,
false in the other.
Some behavioral changes to better match the iOS behavior:
- Long press will open a context menu, where it is possible to start a
selection.
- Selecting "Select" after a long press, shows a new menu with
additional context options.
- Menu is shown at the end of a pan operation when selection is on.
Additional property to control the color handles for the selection