Public Access
The key bar above the software keyboard is now the user's own: which keys, in what order, up to sixteen in two rows that never scroll. Ctrl and Alt latch across the bar and the phone's keyboard, and Ctrl or Alt with a cursor key sends the modified CSI form. Seven predefined groups (essentials, cursor, control, symbols, tmux, vim, function) and keys of one's own, written in \e / ^C notation, are arranged on a customise sheet that saves as it goes. A grid button swaps the software keyboard for a quick-access keyboard of the same height, with KEYS, SNIPPETS, HISTORY and APPEARANCE tabs; it reopens to the tab last used. Snippets go through the shell's existing InsertSnippet. History keeps a typed command only once the remote has echoed it, so nothing typed at a password prompt is ever recorded; it is memory-only and LOCK clears it. Each session pump now keeps its last kilobyte of output and the alternate-screen state for that test (OutputTail). Long-press and drag on the terminal sends arrow keys, as a joystick with three speeds by distance; scrolling is unchanged and there is no mode switch. It takes the touch before Chromium's own long press, so a held finger no longer pastes; paste is on the bar by default instead. A switch in APPEARANCE turns the gesture off. The text-size buttons moved from the bar to APPEARANCE. On wide screens the same tabs open as a side panel beside the terminal, toggled from the top bar, with the bar's own keys repeated at the top of KEYS while the bar stands down. The model, gesture arithmetic, echo reading and history are in DodoSSH.Client.Shell and covered by TerminalKeyboardTests and OutputTailTests. Builds clean; not yet exercised on a device, because the emulator's install is locked behind a passphrase that was not recorded.
48 lines
2.6 KiB
C#
48 lines
2.6 KiB
C#
namespace DodoSSH.Client.Session;
|
|
|
|
/// <summary>
|
|
/// How the phone's terminal keys are arranged on this device.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// <b>Ids, not keys.</b> Every list here names keys and groups by the stable ids in the shell's key catalog
|
|
/// (<c>TerminalKeyCatalog</c>) rather than storing what a key sends, so a fix to a predefined key's bytes
|
|
/// reaches people who customised their bar before the fix. An id this build does not know — one written by
|
|
/// a newer build, or one for a custom key since deleted — is skipped on the way in rather than refused.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>In <see cref="ClientSettings"/>, so on this device and in plain text.</b> The arrangement suits one
|
|
/// screen and one pair of thumbs, which is the same argument the font size makes for not following
|
|
/// somebody onto a desktop. Custom keys are keystrokes such as <c>:wq</c>, and the customise screen says
|
|
/// outright that this file is not a place for a password.
|
|
/// </para>
|
|
/// <para>
|
|
/// Null lists mean "as shipped" rather than "empty". An empty <see cref="Bar"/> is a choice somebody made,
|
|
/// and has to survive a launch as one.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <param name="Bar">The keys on the bar above the software keyboard, in order.</param>
|
|
/// <param name="GroupOrder">The order of the groups on the quick-access keyboard's KEYS tab.</param>
|
|
/// <param name="HiddenGroups">Groups turned off on the KEYS tab.</param>
|
|
/// <param name="CustomKeys">Keys somebody added for themselves.</param>
|
|
/// <param name="QuickAccessTab">The quick-access keyboard's tab last used, which it reopens to.</param>
|
|
/// <param name="SidePanelOpen">Whether a wide screen shows the quick-access keyboard beside the terminal.</param>
|
|
/// <param name="CursorGestures">Whether long-press-and-drag on the terminal moves the cursor.</param>
|
|
public sealed record TerminalKeyboardSettings(
|
|
string[]? Bar = null,
|
|
string[]? GroupOrder = null,
|
|
string[]? HiddenGroups = null,
|
|
CustomTerminalKey[]? CustomKeys = null,
|
|
string? QuickAccessTab = null,
|
|
bool SidePanelOpen = true,
|
|
bool CursorGestures = true);
|
|
|
|
/// <summary>A key somebody added: what it says on it, and what it types.</summary>
|
|
/// <param name="Id">Stable, so the bar can refer to it. Always starts <c>custom:</c>.</param>
|
|
/// <param name="Label">What the key shows.</param>
|
|
/// <param name="Sequence">
|
|
/// What it sends, in the notation the customise screen accepts — <c>\e</c>, <c>\r</c>, <c>^C</c> and so on —
|
|
/// rather than as bytes, so the file stays readable and the parser stays the one place escapes are decided.
|
|
/// </param>
|
|
public sealed record CustomTerminalKey(string Id, string Label, string Sequence);
|