inputmethod

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_ROLE = 0

ERROR_ROLE is the error role value.

View Source
const InputMethodInterface = "zwp_input_method_v2"

InputMethodInterface is the protocol interface name.

View Source
const InputMethodKeyboardGrabInterface = "zwp_input_method_keyboard_grab_v2"

InputMethodKeyboardGrabInterface is the protocol interface name.

View Source
const InputMethodManagerInterface = "zwp_input_method_manager_v2"

InputMethodManagerInterface is the protocol interface name.

View Source
const InputPopupSurfaceInterface = "zwp_input_popup_surface_v2"

InputPopupSurfaceInterface is the protocol interface name.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputMethod

type InputMethod struct {
	wl.BaseProxy
	// contains filtered or unexported fields
}

InputMethod is the generated binding for zwp_input_method_v2 version 1.

func NewInputMethod

func NewInputMethod(ctx *wl.Context) *InputMethod

NewInputMethod returns an unbound InputMethod.

func (*InputMethod) Commit

func (o *InputMethod) Commit(serial uint32) error

Apply state changes from commit_string, set_preedit_string and delete_surrounding_text requests. The state relating to these events is double-buffered, and each one modifies the pending state. This request replaces the current state with the pending state. The connected text input is expected to proceed by evaluating the changes in the following order: 1. Replace existing preedit string with the cursor. 2. Delete requested surrounding text. 3. Insert commit string with the cursor at its end. 4. Calculate surrounding text to send. 5. Insert new preedit text in cursor position. 6. Place cursor inside preedit text. The serial number reflects the last state of the zwp_input_method_v2 object known to the client. The value of the serial argument must be equal to the number of done events already issued by that object. When the compositor receives a commit request with a serial different than the number of past done events, it must proceed as normal, except it should not change the current state of the zwp_input_method_v2 object.

func (*InputMethod) CommitString

func (o *InputMethod) CommitString(text string) error

Send the commit string text for insertion to the application. Inserts a string at current cursor position (see commit event sequence). The string to commit could be either just a single character after a key press or the result of some composing. The argument text is a buffer containing the string to insert. There is a maximum length of wayland messages, so text can not be longer than 4000 bytes. Values set with this event are double-buffered. They must be applied and reset to initial on the next zwp_text_input_v3.commit request. The initial value of text is an empty string.

func (*InputMethod) DeleteSurroundingText

func (o *InputMethod) DeleteSurroundingText(beforeLength uint32, afterLength uint32) error

Remove the surrounding text. before_length and after_length are the number of bytes before and after the current cursor index (excluding the preedit text) to delete. If any preedit text is present, it is replaced with the cursor for the purpose of this event. In effect before_length is counted from the beginning of preedit text, and after_length from its end (see commit event sequence). Values set with this event are double-buffered. They must be applied and reset to initial on the next zwp_input_method_v2.commit request. The initial values of both before_length and after_length are 0.

func (*InputMethod) Destroy

func (o *InputMethod) Destroy() error

Destroys the zwp_text_input_v2 object and any associated child objects, i.e. zwp_input_popup_surface_v2 and zwp_input_method_keyboard_grab_v2.

func (*InputMethod) Dispatch

func (o *InputMethod) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_input_method_v2 and calls the registered handlers.

func (*InputMethod) EventSignature

func (o *InputMethod) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*InputMethod) GetInputPopupSurface

func (o *InputMethod) GetInputPopupSurface(surface *cross_wl_surface.Surface) (*InputPopupSurface, error)

Creates a new zwp_input_popup_surface_v2 object wrapping a given surface. The surface gets assigned the "input_popup" role. If the surface already has an assigned role, the compositor must issue a protocol error.

func (*InputMethod) GrabKeyboard

func (o *InputMethod) GrabKeyboard() (*InputMethodKeyboardGrab, error)

Allow an input method to receive hardware keyboard input and process key events to generate text events (with pre-edit) over the wire. This allows input methods which compose multiple key events for inputting text like it is done for CJK languages. The compositor should send all keyboard events on the seat to the grab holder via the returned wl_keyboard object. Nevertheless, the compositor may decide not to forward any particular event. The compositor must not further process any event after it has been forwarded to the grab holder. Releasing the resulting wl_keyboard object releases the grab.

func (*InputMethod) OnActivate

func (o *InputMethod) OnActivate(handler func())

OnActivate registers a handler for the activate event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) OnContentType

func (o *InputMethod) OnContentType(handler func(hint uint32, purpose uint32))

OnContentType registers a handler for the content_type event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) OnDeactivate

func (o *InputMethod) OnDeactivate(handler func())

OnDeactivate registers a handler for the deactivate event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) OnDone

func (o *InputMethod) OnDone(handler func())

OnDone registers a handler for the done event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) OnSurroundingText

func (o *InputMethod) OnSurroundingText(handler func(text string, cursor uint32, anchor uint32))

OnSurroundingText registers a handler for the surrounding_text event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) OnTextChangeCause

func (o *InputMethod) OnTextChangeCause(handler func(cause uint32))

OnTextChangeCause registers a handler for the text_change_cause event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) OnUnavailable

func (o *InputMethod) OnUnavailable(handler func())

OnUnavailable registers a handler for the unavailable event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethod) SetPreeditString

func (o *InputMethod) SetPreeditString(text string, cursorBegin int32, cursorEnd int32) error

Send the pre-edit string text to the application text input. Place a new composing text (pre-edit) at the current cursor position. Any previously set composing text must be removed. Any previously existing selected text must be removed. The cursor is moved to a new position within the preedit string. The argument text is a buffer containing the preedit string. There is a maximum length of wayland messages, so text can not be longer than 4000 bytes. The arguments cursor_begin and cursor_end are counted in bytes relative to the beginning of the submitted string buffer. Cursor should be hidden by the text input when both are equal to -1. cursor_begin indicates the beginning of the cursor. cursor_end indicates the end of the cursor. It may be equal or different than cursor_begin. Values set with this event are double-buffered. They must be applied on the next zwp_input_method_v2.commit event. The initial value of text is an empty string. The initial value of cursor_begin, and cursor_end are both 0.

type InputMethodKeyboardGrab

type InputMethodKeyboardGrab struct {
	wl.BaseProxy
	// contains filtered or unexported fields
}

InputMethodKeyboardGrab is the generated binding for zwp_input_method_keyboard_grab_v2 version 1.

func NewInputMethodKeyboardGrab

func NewInputMethodKeyboardGrab(ctx *wl.Context) *InputMethodKeyboardGrab

NewInputMethodKeyboardGrab returns an unbound InputMethodKeyboardGrab.

func (*InputMethodKeyboardGrab) Dispatch

func (o *InputMethodKeyboardGrab) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_input_method_keyboard_grab_v2 and calls the registered handlers.

func (*InputMethodKeyboardGrab) EventSignature

func (o *InputMethodKeyboardGrab) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*InputMethodKeyboardGrab) OnKey

func (o *InputMethodKeyboardGrab) OnKey(handler func(serial uint32, time uint32, key uint32, state uint32))

OnKey registers a handler for the key event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethodKeyboardGrab) OnKeymap

func (o *InputMethodKeyboardGrab) OnKeymap(handler func(format uint32, fd *wl.OwnedFD, size uint32))

OnKeymap registers a handler for the keymap event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethodKeyboardGrab) OnModifiers

func (o *InputMethodKeyboardGrab) OnModifiers(handler func(serial uint32, modsDepressed uint32, modsLatched uint32, modsLocked uint32, group uint32))

OnModifiers registers a handler for the modifiers event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethodKeyboardGrab) OnRepeatInfo

func (o *InputMethodKeyboardGrab) OnRepeatInfo(handler func(rate int32, delay int32))

OnRepeatInfo registers a handler for the repeat_info event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*InputMethodKeyboardGrab) Release

func (o *InputMethodKeyboardGrab) Release() error

release the grab object

type InputMethodManager

type InputMethodManager struct {
	wl.BaseProxy
}

InputMethodManager is the generated binding for zwp_input_method_manager_v2 version 1.

func NewInputMethodManager

func NewInputMethodManager(ctx *wl.Context) *InputMethodManager

NewInputMethodManager returns an unbound InputMethodManager.

func (*InputMethodManager) Destroy

func (o *InputMethodManager) Destroy() error

Destroys the zwp_input_method_manager_v2 object. The zwp_input_method_v2 objects originating from it remain valid.

func (*InputMethodManager) Dispatch

func (o *InputMethodManager) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_input_method_manager_v2 and calls the registered handlers.

func (*InputMethodManager) EventSignature

func (o *InputMethodManager) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*InputMethodManager) GetInputMethod

func (o *InputMethodManager) GetInputMethod(seat *cross_wl_seat.Seat) (*InputMethod, error)

Request a new input zwp_input_method_v2 object associated with a given seat.

type InputPopupSurface

type InputPopupSurface struct {
	wl.BaseProxy
	// contains filtered or unexported fields
}

InputPopupSurface is the generated binding for zwp_input_popup_surface_v2 version 1.

func NewInputPopupSurface

func NewInputPopupSurface(ctx *wl.Context) *InputPopupSurface

NewInputPopupSurface returns an unbound InputPopupSurface.

func (*InputPopupSurface) Destroy

func (o *InputPopupSurface) Destroy() error

func (*InputPopupSurface) Dispatch

func (o *InputPopupSurface) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_input_popup_surface_v2 and calls the registered handlers.

func (*InputPopupSurface) EventSignature

func (o *InputPopupSurface) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*InputPopupSurface) OnTextInputRectangle

func (o *InputPopupSurface) OnTextInputRectangle(handler func(x int32, y int32, width int32, height int32))

OnTextInputRectangle registers a handler for the text_input_rectangle event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

Jump to

Keyboard shortcuts

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