diff --git a/doc/touch.md b/doc/touch.md index 7861d4a..2a929e0 100644 --- a/doc/touch.md +++ b/doc/touch.md @@ -11,8 +11,8 @@ Pad avoids high-level widgets and uses the following low-level Gioui ops and eve | `gesture.Click.Add` | `gesture.ClickEvent` | Tap detection for UI elements (buttons, status bar labels, icons). | | `pointer.InputOp` | `pointer.Event` | Editor hit-region. Captures `Press`, `Release`, `Move`, `Drag`, `Scroll` for cursor movement, selection, scrolling. | | `key.InputOp` | `key.Event` | Enables keyboard focus. Captures `Edit` (text insertion), `Press` (Backspace, Enter, Arrows). | -| `key.FocusOp` | — | Requests keyboard focus for the active element. | -| `key.SoftKeyboardOp` | — | Explicitly shows/hides the Android soft keyboard. | +| `gtx.Execute(key.FocusCmd` | — | Requests keyboard focus for the active element. | +| `gtx.Execute(key.SoftKeyboardCmd)` | — | Explicitly shows/hides the Android soft keyboard. | ### 1.1 Op/Event Flow @@ -169,12 +169,12 @@ The `TextField` element must be "focused" to receive keyboard events. Focus is a ### 5.1 Focus Acquisition 1. **Tap on Editor**: User taps the `TextField` region. Main goroutine sends `pointer.Event` (Type: `Press`) to Logic. -2. **Focus Request**: Logic sets `focused = true` and computes a frame with `key.FocusOp` and `key.SoftKeyboardOp(true)`. +2. **Focus Request**: Logic sets `focused = true` and computes a frame with `gtx.Execute(key.FocusCmd` and `gtx.Execute(key.SoftKeyboardCmd{Show: true}`. 3. **Keyboard Appears**: Gioui shows the Android soft keyboard. Subsequent `w.Event()` calls return `key.Event`. ### 5.2 Focus Loss -1. **Tap Outside Editor**: User taps a non-editor region (e.g., status bar, directory browser). Logic sets `focused = false` and computes a frame with `key.SoftKeyboardOp(false)`. +1. **Tap Outside Editor**: User taps a non-editor region (e.g., status bar, directory browser). Logic sets `focused = false` and computes a frame with `gtx.Execute(key.SoftKeyboardOp{Show: false})`. 2. **Keyboard Disappears**: Gioui hides the soft keyboard. ### 5.3 Key Events @@ -387,12 +387,12 @@ The Search button toggles the search bar visible/invisible. 3. If `search_active` is true: - Show `SearchBar` element below the StatusBar. - Set focus to the search bar's text field. - - Show the soft keyboard (`key.SoftKeyboardOp(true)`). + - Show the soft keyboard (`gtx.Execute(key.SoftKeyboardCmd{Show: true}`). 4. If `search_active` is false: - Hide `SearchBar` element. - Clear search query. - Remove focus from search bar. - - Hide soft keyboard (`key.SoftKeyboardOp(false)`). + - Hide soft keyboard (`gtx.Execute(key.SoftKeyboardCmd{Show: false}`). 5. Logic produces a new frame. The Search button is always visible in the StatusBar (unlike Cut/Copy/Paste which are conditional). It serves as the primary way to activate search on Android (where Ctrl+F may not be available).