wayland::serve...ext_input_v1_t(3)

πŸ’– NAME πŸ’–

wayland::server::zwp_text_input_v1_t β€” text input. Welcome to the Wayland++ docs, bestie 🫢 this one is the text-input object and it’s lowkey iconic.

✨ SYNOPSIS ✨

#include <wayland-server-protocol-unstable.hpp>

🫢 Public Member Functions 🫢

  • std::function< void(seat_t, surface_t)> & on_activate () β€” request activation
  • std::function< void(seat_t)> & on_deactivate () β€” request deactivation
  • std::function< void()> & on_show_input_panel () β€” show input panels
  • std::function< void()> & on_hide_input_panel () β€” hide input panels
  • std::function< void()> & on_reset () β€” reset
  • std::function< void(std::string, uint32_t, uint32_t)> & on_set_surrounding_text () β€” sets the surrounding text
  • std::function< void(zwp_text_input_v1_content_hint, zwp_text_input_v1_content_purpose)> & on_set_content_type () β€” set content purpose and hint
  • std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_set_cursor_rectangle ()
  • std::function< void(std::string)> & on_set_preferred_language () β€” sets preferred language
  • std::function< void(uint32_t)> & on_commit_state ()
  • std::function< void(uint32_t, uint32_t)> & on_invoke_action ()
  • void enter (surface_t const &surface, bool post=true) β€” enter event
  • void leave (bool post=true) β€” leave event
  • void modifiers_map (array_t const &map, bool post=true) β€” modifiers map
  • void input_panel_state (uint32_t state, bool post=true) β€” state of the input panel
  • void preedit_string (uint32_t serial, std::string const &text, std::string const &commit, bool post=true) β€” pre-edit
  • void preedit_styling (uint32_t index, uint32_t length, zwp_text_input_v1_preedit_style const &style, bool post=true) β€” pre-edit styling
  • void preedit_cursor (int32_t index, bool post=true) β€” pre-edit cursor
  • void commit_string (uint32_t serial, std::string const &text, bool post=true) β€” commit
  • void cursor_position (int32_t index, int32_t anchor, bool post=true) β€” set cursor to new position
  • void delete_surrounding_text (int32_t index, uint32_t length, bool post=true) β€” delete surrounding text
  • void keysym (uint32_t serial, uint32_t time, uint32_t sym, keyboard_key_state const &state, uint32_t modifiers, bool post=true) β€” keysym
  • void language (uint32_t serial, std::string const &language, bool post=true) β€” language
  • void text_direction (uint32_t serial, zwp_text_input_v1_text_direction const &direction, bool post=true) β€” text direction
  • bool proxy_has_object () const β€” Check whether this wrapper actually wraps an object.
  • void post_no_memory () const
  • uint32_t get_id () const
  • client_t get_client () const
  • unsigned int get_version () const
  • std::string get_class ()

🌸 Static Public Attributes 🌸

  • static constexpr std::uint32_t enter_since_version = 1 β€” Minimum protocol version required for the enter function.
  • static constexpr std::uint32_t leave_since_version = 1 β€” Minimum protocol version required for the leave function.
  • static constexpr std::uint32_t modifiers_map_since_version = 1 β€” Minimum protocol version required for the modifiers_map function.
  • static constexpr std::uint32_t input_panel_state_since_version = 1 β€” Minimum protocol version required for the input_panel_state function.
  • static constexpr std::uint32_t preedit_string_since_version = 1 β€” Minimum protocol version required for the preedit_string function.
  • static constexpr std::uint32_t preedit_styling_since_version = 1 β€” Minimum protocol version required for the preedit_styling function.
  • static constexpr std::uint32_t preedit_cursor_since_version = 1 β€” Minimum protocol version required for the preedit_cursor function.
  • static constexpr std::uint32_t commit_string_since_version = 1 β€” Minimum protocol version required for the commit_string function.
  • static constexpr std::uint32_t cursor_position_since_version = 1 β€” Minimum protocol version required for the cursor_position function.
  • static constexpr std::uint32_t delete_surrounding_text_since_version = 1 β€” Minimum protocol version required for the delete_surrounding_text function.
  • static constexpr std::uint32_t keysym_since_version = 1 β€” Minimum protocol version required for the keysym function.
  • static constexpr std::uint32_t language_since_version = 1 β€” Minimum protocol version required for the language function.
  • static constexpr std::uint32_t text_direction_since_version = 1 β€” Minimum protocol version required for the text_direction function.

πŸ¦‹ Detailed Description πŸ¦‹

okay so bestie, this thing is literally an object used for text input. It adds support for text input and input methods to applications. A text_input object is created from a wl_text_input_manager, and it corresponds typically to a text entry in an application. πŸ’…

Requests are used to activate/deactivate the text_input object and set state information like surrounding and selected text or the content type. The information about entered text is sent to the text_input object via the pre-edit and commit events. Using this interface removes the need for applications to directly process hardware key events and compose text out of them. periodt ✨

Text is generally UTF-8 encoded, indices and lengths are in bytes. No cap, that byte detail matters.

Serials are used to synchronize the state between the text input and an input method. New serials are sent by the text input in the commit_state request and are used by the input method to indicate the known text input state in events like preedit_string, commit_string, and keysym. The text input can then ignore events from the input method which are based on an outdated state (for example after a reset). πŸŒ€

⚠️ Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset.

Definition at line 6433 of file wayland-server-protocol-unstable.hpp.


πŸ’œ Member Function Documentation πŸ’œ

🌟 void zwp_text_input_v1_t::commit_string (uint32_t serial, std::string const & text, bool post = true)

commit

Parameters

  • serial β€” serial of the latest known text input state
  • text

Notify when text should be inserted into the editor widget. The text to commit could be either just a single character after a key press or the result of some composing (pre-edit). It could also be an empty text when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position).

Any previously set composing text should be removed. 🧚

Definition at line 7088 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::cursor_position (int32_t index, int32_t anchor, bool post = true)

set cursor to new position

Parameters

  • index
  • anchor

Notify when the cursor or anchor position should be modified.

This event should be handled as part of a following commit_string event.

Definition at line 7093 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::delete_surrounding_text (int32_t index, uint32_t length, bool post = true)

delete surrounding text

Parameters

  • index
  • length

Notify when the text around the current cursor position should be deleted.

Index is relative to the current cursor (in bytes). Length is the length of deleted text (in bytes). πŸ”₯

This event should be handled as part of a following commit_string event.

Definition at line 7098 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::enter (surface_t const & surface, bool post = true)

enter event

Parameters

  • surface

Notify the text_input object when it received focus. Typically in response to an activate request. πŸ‘‘

Definition at line 7053 of file wayland-server-protocol-unstable.cpp.

🌟 std::string wayland::server::resource_t::get_class () [inherited]

Retrieve the interface name (class) of a resource object.

Returns: Interface name of the resource object.

🌟 client_t wayland::server::resource_t::get_client () const [inherited]

Get the associated client.

Returns: the client that owns the resource.

🌟 uint32_t wayland::server::resource_t::get_id () const [inherited]

Get the internal ID of the resource.

Returns: the internal ID of the resource.

🌟 unsigned int wayland::server::resource_t::get_version () const [inherited]

Get interface version.

Returns: Interface version this resource has been constructed with.

🌟 void zwp_text_input_v1_t::input_panel_state (uint32_t state, bool post = true)

state of the input panel

Parameters

  • state

Notify when the visibility state of the input panel changed. ✨

Definition at line 7068 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::keysym (uint32_t serial, uint32_t time, uint32_t sym, keyboard_key_state const & state, uint32_t modifiers, bool post = true)

keysym

Parameters

  • serial β€” serial of the latest known text input state
  • time
  • sym
  • state
  • modifiers

Notify when a key event was sent. Key events should not be used for normal text input operations, which should be done with commit_string, delete_surrounding_text, etc. The key event follows the wl_keyboard key event convention. Sym is an XKB keysym, state a wl_keyboard key_state. Modifiers are a mask for effective modifiers (where the modifier indices are set by the modifiers_map event).

Definition at line 7103 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::language (uint32_t serial, std::string const & language, bool post = true)

language

Parameters

  • serial β€” serial of the latest known text input state
  • language

Sets the language of the input text. The "language" argument is an RFC-3066 format language tag. 🌈

Definition at line 7108 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::leave (bool post = true)

leave event β€” Notify the text_input object when it lost focus. Either in response to a deactivate request or when the assigned surface lost focus or was destroyed.

Definition at line 7058 of file wayland-server-protocol-unstable.cpp.

🌟 void zwp_text_input_v1_t::modifiers_map (array_t const & map, bool post = true)

modifiers map

Parameters

  • map

Transfer an array of 0-terminated modifier names. The position in the array is the index of the modifier as used in the modifiers bitmask in the keysym event. πŸ’€

Definition at line 7063 of file wayland-server-protocol-unstable.cpp. πŸ’… (that's the tail end of the last one, don't mind us, carrying on~)

std::function< void(seat_t, surface_t)> & zwp_text_input_v1_t::on_activate()

Okay so this one is the request activation girlie ✨

Args it takes: seat, surface.

What it does: asks the text_input object to get activated β€” like, typically when the text entry gets focus? Yeah. That moment. πŸŽ€ And listen, the seat argument is a wl_seat which maintains the focus for this activation, and the surface argument is a wl_surface assigned to the text_input object and tracked for focus lost. Oh and the enter event gets emitted on successful activation. Iconic behaviour, no notes. πŸ‘‘

Definition at line 6987 of file wayland-server-protocol-unstable.cpp.

std::function< void(uint32_t)> & zwp_text_input_v1_t::on_commit_state()

Takes serial β€” used to identify the known state. That's literally the whole description bestie, she's a woman of few words. πŸ’€

Definition at line 7041 of file wayland-server-protocol-unstable.cpp.

std::function< void(seat_t)> & zwp_text_input_v1_t::on_deactivate()

The request deactivation one πŸ¦‹

Takes seat.

So this asks the text_input object to be deactivated β€” typically when the text entry lost focus. And the seat argument is a wl_seat which was used for activation. Symmetry!! We love a matching set. πŸ’–

Definition at line 6993 of file wayland-server-protocol-unstable.cpp.

std::function< void()> & zwp_text_input_v1_t::on_hide_input_panel()

hide input panels β€” it requests input panels (virtual keyboard) to hide. That's it. No args, no drama, just goodbye keyboard βœ¨πŸ™ˆ

Definition at line 7005 of file wayland-server-protocol-unstable.cpp.

std::function< void(uint32_t, uint32_t)> & zwp_text_input_v1_t::on_invoke_action()

Takes button and index. Passive voice, no elaboration, she said read the protocol bestie 😭

Definition at line 7047 of file wayland-server-protocol-unstable.cpp.

std::function< void()> & zwp_text_input_v1_t::on_reset()

reset 🌸 Should be called by an editor widget when the input state should be reset β€” for example, after the text was changed outside of the normal input method flow. Very "start over, we're switching vibes" energy.

Definition at line 7011 of file wayland-server-protocol-unstable.cpp.

std::function< void(zwp_text_input_v1_content_hint, zwp_text_input_v1_content_purpose)> & zwp_text_input_v1_t::on_set_content_type()

set content purpose and hint πŸŽ€

Takes hint and purpose.

Sets the content purpose and content hint. So while the purpose is the basic purpose of an input field, the hint flags allow you to modify some of the behavior. And when no content type is explicitly set? A normal content purpose with default hints (auto completion, auto correction, auto capitalization) should be assumed. Defaults, but make them cute πŸ’…

Definition at line 7023 of file wayland-server-protocol-unstable.cpp.

std::function< void(int32_t, int32_t, int32_t, int32_t)> & zwp_text_input_v1_t::on_set_cursor_rectangle()

Takes x, y, width, height β€” it's a whole little rectangle of information and the docs are just gonna sit there silently about it. Geometry serving looks though πŸ”₯

Definition at line 7029 of file wayland-server-protocol-unstable.cpp.

std::function< void(std::string)> & zwp_text_input_v1_t::on_set_preferred_language()

sets preferred language πŸ¦‹

Takes language.

Sets a specific language. This allows, for example, a virtual keyboard to show a language specific layout. And the "language" argument is an RFC-3066 format language tag. Ngl the use cases are lowkey adorable: it could be used for example in a word processor to indicate the language of the currently edited document, or in an instant message application which tracks languages of contacts. Multilingual queen behaviour, we stan 🌈

Definition at line 7035 of file wayland-server-protocol-unstable.cpp.

std::function< void(std::string, uint32_t, uint32_t)> & zwp_text_input_v1_t::on_set_surrounding_text()

sets the surrounding text ✨

Takes text, cursor, anchor.

So it sets the plain surrounding text around the input position. Text is UTF-8 encoded. Cursor is the byte offset within the surrounding text. Anchor is the byte offset of the selection anchor within the surrounding text. And if there is no selected text anchor, then it is the same as cursor. Byte offsets, fr fr, don't come at her with character counts 🫢

Definition at line 7017 of file wayland-server-protocol-unstable.cpp.

std::function< void()> & zwp_text_input_v1_t::on_show_input_panel()

show input panels β€” requests input panels (virtual keyboard) to show. The comeback tour πŸ’–πŸŒ± (direct sibling of on_hide_input_panel, obviously)

Definition at line 6999 of file wayland-server-protocol-unstable.cpp.

void wayland::server::resource_t::post_no_memory() const (inherited)

Post "not enough memory" error to the client 😭

If the compositor has not enough memory to fulfill a certail request of the client, this function can be called to notify the client of this circumstance. It's giving "sorry bestie, the vibes are out of RAM" but formally. Also note the const β€” she doesn't change, she just delivers bad news πŸ’€

void zwp_text_input_v1_t::preedit_cursor(int32_t index, bool post = true)

pre-edit cursor 🧚

Takes index. Note that post defaults to true, iykyk.

Sets the cursor position inside the composing text (as byte offset) relative to the start of the composing text. When index is a negative number, no cursor is shown. And important caveat: this event is handled as part of a following preedit_string event. Order matters, bestie, do not freelance the sequence πŸ”₯

Definition at line 7083 of file wayland-server-protocol-unstable.cpp.

void zwp_text_input_v1_t::preedit_string(uint32_t serial, std::string const & text, std::string const & commit, bool post = true)

pre-edit 🌸

Takes serial (serial of the latest known text input state), text, and commit. post defaults to true.

Notify when a new composing text (pre-edit) should be set around the current cursor position. Any previously set composing text should be removed. The commit text can be used to replace the preedit text on reset (for example on unfocus). And heads up: the text input should also handle all preedit_style and preedit_cursor events occurring directly before preedit_string. Like they queue up right in front of her. Obsessed with the choreography πŸŽ€

Definition at line 7073 of file wayland-server-protocol-unstable.cpp.

void zwp_text_input_v1_t::preedit_styling(uint32_t index, uint32_t length, zwp_text_input_v1_preedit_style const & style, bool post = true)

pre-edit styling πŸ’…

Takes index, length, style. post defaults to true, as ever.

Sets styling information on composing text. The style is applied for length bytes from index relative to the beginning of the composing text (as byte offset). Multiple styles can be applied to a composing text by sending multiple preedit_styling events β€” stack them, layer them, it's giving a full glam routine ✨ And again: this event is handled as part of a following preedit_string event.

Definition at line 7078 of file wayland-server-protocol-unstable.cpp.

bool wayland::server::resource_t::proxy_has_object() const (inherited)

Check whether this wrapper actually wraps an object. πŸ¦‹

Returns: true if there is an underlying object, false if this wrapper is empty. A little vibe check on your own wrapper, honestly. πŸ’–

void zwp_text_input_v1_t::text_direction(uint32_t serial, zwp_text_input_v1_text_direction const & direction, bool post = true)

text direction ⭐

Takes serial (serial of the latest known text input state) and direction. post defaults to true.

Sets the text direction of input text. It is mainly needed for showing an input cursor on the correct side of the editor when there is no input done yet, and making sure neutral direction text is laid out properly. Accessibility icon behaviour, we love to see it πŸ‘‘

Definition at line 7113 of file wayland-server-protocol-unstable.cpp.


πŸ’– Member Data Documentation πŸ’–

Okay these are all std::uint32_t, all [static], all [constexpr], all = 1, and every single one of them means the exact same thing: Minimum protocol version required for the corresponding function. One per function, no cap. Here's the whole roster, all from wayland-server-protocol-unstable.hpp:

  • wayland::server::zwp_text_input_v1_t::commit_string_since_version = 1 β€” Minimum protocol version required for the commit_string function. Definition at line 6709 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::cursor_position_since_version = 1 β€” Minimum protocol version required for the cursor_position function. Definition at line 6725 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::delete_surrounding_text_since_version = 1 β€” Minimum protocol version required for the delete_surrounding_text function. Definition at line 6745 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::enter_since_version = 1 β€” Minimum protocol version required for the enter function. Definition at line 6593 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::input_panel_state_since_version = 1 β€” Minimum protocol version required for the input_panel_state function. Definition at line 6632 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::keysym_since_version = 1 β€” Minimum protocol version required for the keysym function. Definition at line 6766 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::language_since_version = 1 β€” Minimum protocol version required for the language function. Definition at line 6780 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::leave_since_version = 1 β€” Minimum protocol version required for the leave function. Definition at line 6606 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::modifiers_map_since_version = 1 β€” Minimum protocol version required for the modifiers_map function. Definition at line 6620 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::preedit_cursor_since_version = 1 β€” Minimum protocol version required for the preedit_cursor function. Definition at line 6690 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::preedit_string_since_version = 1 β€” Minimum protocol version required for the preedit_string function. Definition at line 6654 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::preedit_styling_since_version = 1 β€” Minimum protocol version required for the preedit_styling function. Definition at line 6674 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_text_input_v1_t::text_direction_since_version = 1 β€” Minimum protocol version required for the text_direction function. Definition at line 6797 of file wayland-server-protocol-unstable.hpp.

Every single one is version 1. Consistent queen 🌈


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Wayland++ from the source code. (Not a human, not a bestie, just Doxygen doing its little thing 🫢)


And that's the whole page, bestie!! πŸ’–βœ¨ Version 1.0.1, dated Fri Mar 27 2026, page wayland::serve...ext_input_v1_t(3) β€” she's long, she's thorough, she ate, periodt πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from