|
4 | 4 | * Defines two exports: |
5 | 5 | * |
6 | 6 | * - KeyboardAccessoryBar (singleton object) — Quick action buttons shown above the virtual |
7 | | - * keyboard on mobile: arrow up/down, /init, /clear, /compact, paste, and dismiss. |
| 7 | + * keyboard on mobile: arrow up/down, Shift+Tab, /init, /clear, /compact, paste, and dismiss. |
8 | 8 | * Destructive actions (/clear, /compact) require double-tap confirmation (2s amber state). |
9 | 9 | * Commands are sent as text + Enter separately for Ink compatibility. |
10 | 10 | * Only initializes on touch devices (MobileDetection.isTouchDevice guard). |
@@ -53,6 +53,7 @@ const KeyboardAccessoryBar = { |
53 | 53 | <path d="M19 9l-7 7-7-7"/> |
54 | 54 | </svg> |
55 | 55 | </button> |
| 56 | + <button class="accessory-btn" data-action="shift-tab" title="Shift+Tab">⇧Tab</button> |
56 | 57 | <button class="accessory-btn" data-action="init" title="/init">/init</button> |
57 | 58 | <button class="accessory-btn" data-action="clear" title="/clear">/clear</button> |
58 | 59 | <button class="accessory-btn" data-action="compact" title="/compact">/compact</button> |
@@ -80,7 +81,7 @@ const KeyboardAccessoryBar = { |
80 | 81 | this.handleAction(action, btn); |
81 | 82 |
|
82 | 83 | // Refocus terminal so keyboard stays open (tap blurs terminal → keyboard dismisses → toolbar shifts) |
83 | | - if ((action === 'scroll-up' || action === 'scroll-down') || |
| 84 | + if ((action === 'scroll-up' || action === 'scroll-down' || action === 'shift-tab') || |
84 | 85 | ((action === 'clear' || action === 'compact') && this._confirmAction)) { |
85 | 86 | if (typeof app !== 'undefined' && app.terminal) { |
86 | 87 | app.terminal.focus(); |
@@ -109,6 +110,9 @@ const KeyboardAccessoryBar = { |
109 | 110 | case 'scroll-down': |
110 | 111 | this.sendKey('\x1b[B'); |
111 | 112 | break; |
| 113 | + case 'shift-tab': |
| 114 | + this.sendKey('\x1b[Z'); |
| 115 | + break; |
112 | 116 | case 'init': |
113 | 117 | this.sendCommand('/init'); |
114 | 118 | break; |
|
0 commit comments