textinput

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package textinput provides implementations for text input targets and focus tracking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FocusProvider

type FocusProvider struct {
	// contains filtered or unexported fields
}

FocusProvider tracks which text input target currently has focus. It implements port.FocusedInputProvider.

func NewFocusProvider

func NewFocusProvider() *FocusProvider

NewFocusProvider creates a new focus provider.

func (*FocusProvider) GetFocusedInput

func (fp *FocusProvider) GetFocusedInput() port.TextInputTarget

GetFocusedInput returns the currently focused text input target. Returns nil if no text input has focus.

func (*FocusProvider) SetFocusedInput

func (fp *FocusProvider) SetFocusedInput(target port.TextInputTarget)

SetFocusedInput sets the currently focused text input target. Pass nil to clear focus.

type GTKEntryTarget

type GTKEntryTarget struct {
	// contains filtered or unexported fields
}

GTKEntryTarget implements TextInputTarget for GTK SearchEntry widgets. It uses the Editable interface methods to insert and delete text.

func NewGTKEntryTarget

func NewGTKEntryTarget(entry *gtk.SearchEntry) *GTKEntryTarget

NewGTKEntryTarget creates a new GTK entry target for a SearchEntry.

func (*GTKEntryTarget) DeleteBeforeCursor

func (t *GTKEntryTarget) DeleteBeforeCursor(ctx context.Context, n int) error

DeleteBeforeCursor deletes n characters before the cursor position.

func (*GTKEntryTarget) InsertText

func (t *GTKEntryTarget) InsertText(ctx context.Context, text string) error

InsertText inserts text at the current cursor position.

func (*GTKEntryTarget) IsGTKEntryTarget added in v0.28.0

func (*GTKEntryTarget) IsGTKEntryTarget() bool

IsGTKEntryTarget implements port.EntryInputTarget.

type WebViewTarget

type WebViewTarget struct {
	// contains filtered or unexported fields
}

WebViewTarget implements text input and focus restoration for WebView fields.

func NewWebViewTarget

func NewWebViewTarget(webView *webkit.WebView) *WebViewTarget

NewWebViewTarget creates a new WebView target.

func (*WebViewTarget) DeleteBeforeCursor

func (t *WebViewTarget) DeleteBeforeCursor(ctx context.Context, n int) error

DeleteBeforeCursor deletes n characters before the cursor in the WebView. Uses JavaScript to manipulate the focused input element.

func (*WebViewTarget) Focus added in v0.28.0

func (t *WebViewTarget) Focus(_ context.Context)

Focus restores GTK focus to the WebView widget and refocuses the last editable element inside the page.

func (*WebViewTarget) InsertText

func (t *WebViewTarget) InsertText(ctx context.Context, text string) error

InsertText inserts text at the current cursor position in the WebView.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL