feat(html): mobile virtual keyboard and touch UX improvements#1504
Open
someonegg wants to merge 6 commits intotsl0922:mainfrom
Open
feat(html): mobile virtual keyboard and touch UX improvements#1504someonegg wants to merge 6 commits intotsl0922:mainfrom
someonegg wants to merge 6 commits intotsl0922:mainfrom
Conversation
Author
51ca63c to
7fb5a3a
Compare
7fb5a3a to
bbcb50e
Compare
ee05f21 to
a9b2d19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Summary
This PR delivers a mobile-focused UX upgrade for ttyd and includes related fixes in the same series.
Commits included:
Features
Virtual Keyboard Panel
enter,space,batch_inputup,down,left,right,home,end,pageup,pagedown,wheel_up,wheel_downa-zmobileKeyboardCustomKeyscan also be used inmobileKeyboardLayouts.Esc,Tab,Shift,Alt,Ctrl, andCopy/Paste.Tap Selection
Hold Repeat
mobileKeyboardHoldDelayMs(default:300ms).mobileKeyboardHoldIntervalMs(default:120ms).mobileKeyboardHoldWheelIntervalMs(default:120ms).Details
Client Options
-t enableMobileKeyboard=true: enable the mobile virtual keyboard panel, auto-detect touch (default: false). On touch devices this also controls selection-copy behavior: when enabled, tap selection is on and automatic copy-on-selection is off; when disabled, tap selection is off and automatic copy-on-selection is on-t mobileKeyboardOpacity=0.8: set the keyboard panel opacity (default: 0.72, range: 0.0-1.0)-t mobileKeyboardScale=1.2: set the keyboard panel scale (default: 1.0)-t 'mobileKeyboardCustomKeys=[{"id":"tmux_copy_mode","label":"C-b [","combo":["Ctrl+b","["]}]': define custom dynamic keys (array of{id,label,combo};combois a sequence likeCtrl+b,[).idmust match^[a-z][a-z0-9_]{0,31}$, and__proto__,prototype,constructor,toString,valueOfare forbidden. The default web UI predefines six tmux keys:tmux_copy_mode(C-b [),tmux_detach(C-b d),tmux_new_window(C-b c),tmux_prev_window(C-b p),tmux_next_window(C-b n),tmux_list_windows(C-b w)-t 'mobileKeyboardLayouts=[["home","up","end","left","down","right"]]': set dynamic layouts for the top section (6 keys per layout). In the default web UI, 3 pages are active by default: page 1["home","up","end","left","down","right"], page 2["enter","up","batch_input","left","down","right"], page 3["enter","up","space","tmux_next_window","down","tmux_list_windows"]mobileKeyboardLayoutsitem can also be an object{"key":"xxx","page":n}. Whenpageis set, pressing that key sends its action first, then switches to the target layout page (pageis 1-based). Invalid, non-integer, or out-of-rangepagevalues are ignored for switching while key dispatch still works.-t mobileKeyboardHoldDelayMs=300: set hold trigger delay in milliseconds for mobile virtual keys (default: 300)-t mobileKeyboardHoldIntervalMs=120: set hold repeat interval in milliseconds for non-wheel keys (default: 120)-t mobileKeyboardHoldWheelIntervalMs=120: set hold repeat interval in milliseconds for wheel keys (default: 120)Main Files
html/src/components/terminal/xterm/mobile-keyboard.ts(new)html/src/components/terminal/xterm/index.ts(integration/lifecycle/options/events)html/src/components/app.tsx(defaults)html/src/style/index.scss(mobile panel/touch styles)man/ttyd.man.md(source markdown docs)man/ttyd.1(generated fromman/ttyd.man.md)Testing
Automated
Manual Checklist
Compatibility