Skip to content

feat: latch Shift in the extra-keys row - #35

Merged
nimrc merged 3 commits into
mainfrom
feat/extra-keys-shift
Nov 19, 2026
Merged

nimrc merged 3 commits into
mainfrom
feat/extra-keys-shift

Conversation

@nimrc

@nimrc nimrc commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #31.

Adds a latching Shift key to the extra-keys row (Esc, Tab, Shift, Ctrl, Alt, …) so touch users can send Shift+arrow and other Shift chords, such as Codex's Shift+Left or Shift+Tab, without a hardware keyboard.

  • The native core already forwards the Shift bit to Herdr (Modifiers::from_meta_state), so arrows, Tab (back-tab), Home/End and PgUp/PgDn need no Rust change. shift_reaches_navigation_keys covers Shift+Left and Shift+Ctrl+Left.
  • TerminalView.sendText used to consume the latch only for Ctrl/Alt, so a Shift-only latch stayed on after typing. A latched Shift now upper-cases a single typed character and is consumed. With Ctrl/Alt it goes through the existing chord path.
  • Shift combines with Ctrl and Alt, and tapping it again cancels it (reuses the existing ExtraKey.Modifier latch).
  • README, both sites (en and zh), release notes and the site changelog for 1.1.3.

Verification

  • CI: Rust fmt/clippy/tests, Kotlin unit tests, APKs, and the emulator e2e job are green.
  • New e2e GlassUiTest.t10_shiftLatchesForTheNextKey runs on the CI emulator against the runner's sshd + Herdr: in cat -v it taps Shift then ←, Shift then Tab, then a plain ←, and asserts the pane shows ^[[1;2D, ^[[Z, and ^[[D.
  • Against a local Herdr 0.9.5 daemon, Key{Left, SHIFT} → ^[[1;2D, Key{BackTab, SHIFT} → ^[[Z, Shift+Alt+Left → ^[[1;4D.

Screenshots

Shift latched Shift+←, Shift+Tab, then ← in cat -v What's new lists 1.1.3

Add a Shift key beside Ctrl and Alt so touch users can send Shift+arrow
and other Shift chords (e.g. Codex's Shift+Left). The native core already
forwards the Shift bit to Herdr; the only gap was sendText, which kept a
Shift-only latch alive after a typed character. A latched Shift now
upper-cases a single typed character and is consumed like Ctrl and Alt.
GlassUiTest.t10 attaches to the CI host, runs cat -v, and taps Shift then
← and Shift then Tab in the extra-keys row: the pane must show ^[[1;2D and
^[[Z, and the next ← must be plain. Its screenshots are the PR's evidence.
Also lists Shift on the Chinese site, which the first commit missed.
@nimrc
nimrc merged commit 8f71125 into main Nov 19, 2026
5 checks passed
@nimrc
nimrc deleted the feat/extra-keys-shift branch November 19, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

功能请求:扩展键盘增加 Shift 修饰键,支持 Shift + 方向键等组合操作

1 participant