terminal emulator
git clone https://git.lucas.co/cce-terminal.git
feat(osk): a focused terminal says it takes typing
A focused terminal always takes keys, so it claims text input every frame
(cce_ui::text_input::claim): at the cursor cell when it is on screen, else
the whole grid. A touch on the terminal now raises the compositor's
on-screen keyboard; a mouse click does not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/main.rs | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 4493d93..16cf394 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1206,10 +1206,17 @@ impl Application for TerminalApp {
// Cursor last, over the glyphs. Only when visible in the viewport
// (scrolled history moves it off) and not hidden by DECTCEM.
- if cursor_shape != CursorShape::Hidden
+ let cursor_shown = cursor_shape != CursorShape::Hidden
&& mode.contains(TermMode::SHOW_CURSOR)
- && (0..rows as i32).contains(&cursor_row)
- {
+ && (0..rows as i32).contains(&cursor_row);
+ // A focused terminal always takes typing: say so, so a touch raises
+ // the on-screen keyboard. At the cursor cell when it is on screen,
+ // else the whole grid (a TUI hiding it, or scrolled history).
+ if self.focused {
+ let at = if cursor_shown { self.cell_rect(cursor_row as usize, cursor_col, 1) } else { frame };
+ cce_ui::text_input::claim(at.x, at.y, at.width, at.height);
+ }
+ if cursor_shown {
let rect = self.cell_rect(cursor_row as usize, cursor_col, 1);
if !self.focused {
// Hollow outline while unfocused.