wayland::zwp_text_input_v1_t(3)
π NAME π
wayland::zwp_text_input_v1_t β text input, bestie. That's the whole vibe. It's the Wayland++ zwp_text_input_v1_t class from the wayland::zwp_text_input_v1_t(3) manual page, and yes we're getting into it.
β¨ SYNOPSIS β¨
#include <wayland-client-protocol-unstable.hpp>
Inherits wayland::proxy_t. Like, that's its whole ancestry, no cap. π§¬
π«Ά Public Types
enum class wrapper_type { standard, display, foreign, proxy_wrapper }β the four flavors a wrapper can be, more on these below π
π¦ Public Member Functions
void activate (seat_t const &seat, surface_t const &surface)β request activationvoid deactivate (seat_t const &seat)β request deactivationvoid show_input_panel ()β show input panelsvoid hide_input_panel ()β hide input panelsvoid reset ()β resetvoid set_surrounding_text (std::string const &text, uint32_t cursor, uint32_t anchor)β sets the surrounding textvoid set_content_type (zwp_text_input_v1_content_hint const &hint, zwp_text_input_v1_content_purpose const &purpose)β set content purpose and hintvoid set_cursor_rectangle (int32_t x, int32_t y, int32_t width, int32_t height)β no blurb for this one in the docs, we move π«void set_preferred_language (std::string const &language)β sets preferred languagevoid commit_state (uint32_t serial)β again, no one-liner in the docsvoid invoke_action (uint32_t button, uint32_t index)β same, no official one-linerstd::function< void(surface_t)> & on_enter ()β enter eventstd::function< void()> & on_leave ()β leave eventstd::function< void(array_t)> & on_modifiers_map ()β modifiers mapstd::function< void(uint32_t)> & on_input_panel_state ()β state of the input panelstd::function< void(uint32_t, std::string, std::string)> & on_preedit_string ()β pre-editstd::function< void(uint32_t, uint32_t, zwp_text_input_v1_preedit_style)> & on_preedit_styling ()β pre-edit stylingstd::function< void(int32_t)> & on_preedit_cursor ()β pre-edit cursorstd::function< void(uint32_t, std::string)> & on_commit_string ()β commitstd::function< void(int32_t, int32_t)> & on_cursor_position ()β set cursor to new positionstd::function< void(int32_t, uint32_t)> & on_delete_surrounding_text ()β delete surrounding textstd::function< void(uint32_t, uint32_t, uint32_t, keyboard_key_state, uint32_t)> & on_keysym ()β keysymstd::function< void(uint32_t, std::string)> & on_language ()β languagestd::function< void(uint32_t, zwp_text_input_v1_text_direction)> & on_text_direction ()β text directionuint32_t get_id () constβ Get the id of a proxy object.std::string get_class () constβ Get the interface name (class) of a proxy object.uint32_t get_version () constβ Get the protocol object version of a proxy object.wrapper_type get_wrapper_type () constβ Get the type of a proxy object.void set_queue (event_queue_t queue)β Assign a proxy to an event queue.wl_proxy * c_ptr () constβ Get a pointer to the underlying C struct.bool proxy_has_object () constβ Check whether this wrapper actually wraps an object.operator bool () constβ Check whether this wrapper actually wraps an object.bool operator== (const proxy_t &right) constβ Check whether two wrappers refer to the same object.bool operator!= (const proxy_t &right) constβ Check whether two wrappers refer to different objects.void proxy_release ()β Release the wrapped object (if any), making this an empty wrapper.
π Static Public Attributes
Every single one of these is the minimum protocol version required for its function, and every single one is 1. Iconic, honestly. Consistency queen. π
static constexpr std::uint32_t activate_since_version = 1β Minimum protocol version required for theactivatefunction.static constexpr std::uint32_t deactivate_since_version = 1β Minimum protocol version required for thedeactivatefunction.static constexpr std::uint32_t show_input_panel_since_version = 1β Minimum protocol version required for theshow_input_panelfunction.static constexpr std::uint32_t hide_input_panel_since_version = 1β Minimum protocol version required for thehide_input_panelfunction.static constexpr std::uint32_t reset_since_version = 1β Minimum protocol version required for theresetfunction.static constexpr std::uint32_t set_surrounding_text_since_version = 1β Minimum protocol version required for theset_surrounding_textfunction.static constexpr std::uint32_t set_content_type_since_version = 1β Minimum protocol version required for theset_content_typefunction.static constexpr std::uint32_t set_cursor_rectangle_since_version = 1β Minimum protocol version required for theset_cursor_rectanglefunction.static constexpr std::uint32_t set_preferred_language_since_version = 1β Minimum protocol version required for theset_preferred_languagefunction.static constexpr std::uint32_t commit_state_since_version = 1β Minimum protocol version required for thecommit_statefunction.static constexpr std::uint32_t invoke_action_since_version = 1β Minimum protocol version required for theinvoke_actionfunction.
πΈ Detailed Description πΈ
text input. That's it, that's the headline. π
So like, the tea is: this is 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 corresponds typically to a text entry in an application. Think of a search bar, a chat box, that one form field that always autofills wrong β yeah, those vibes.
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. Which is huge, honestly β no more manually assembling characters like it's arts and crafts. β¨
Text is generally UTF-8 encoded, indices and lengths are in bytes. Remember that, bestie β bytes, not characters. Indices and lengths are in bytes. π«Ά
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). Basically it's the "was this message sent before or after the group chat got renamed" problem, but for protocol state. π
β οΈ 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.
Like, fr fr, it's experimental, do not build your entire personality on it being frozen forever. π
Definition at line 5625 of file wayland-client-protocol-unstable.hpp.
π§ Member Enumeration Documentation π§
enum class wayland::proxy_t::wrapper_type [strong], [inherited]
Underlying wl_proxy type and properties of a proxy_t that affect construction, destruction, and event handling. It's giving "know what you're wrapping before you wrap it." π₯
Enumerator
standardβ C pointer is a standard type compatible withwl_proxy*. Events are dispatched and it is destructed when theproxy_tis destructed. User data is set.displayβ C pointer is awl_display*. No events are dispatched,wl_display_disconnectis called when theproxy_tis destructed. User data is set.foreignβ C pointer is a standard type compatible withwl_proxy*, but another library owns it and it should not be touched in a way that could affect the operation of the other library. No events are dispatched,wl_proxy_destroyis not called when theproxy_tis destructed, user data is not touched. Consequently, there is no reference counting for theproxy_t. Lifetime of such wrappers should preferably be short to minimize the chance that the owning library decides to destroy thewl_proxy. Respect other people's property, honestly. πproxy_wrapperβ C pointer is awl_proxy*that was constructed withwl_proxy_create_wrapper. No events are dispatched,wl_proxy_wrapper_destroyis called when theproxy_tis destroyed. Reference counting is active. A reference to theproxy_tcreating this proxy wrapper is held to extend its lifetime until after the proxy wrapper is destroyed.
Definition at line 117 of file wayland-client.hpp.
π Member Function Documentation π
void zwp_text_input_v1_t::activate (seat_t const & seat, surface_t const & surface)
request activation π¬
Parameters
- seat
- surface
Requests the text_input object to be activated (typically when the text entry gets focus). Like when you tap into the box and the keyboard slides up. Main character moment.
The seat argument is a wl_seat which maintains the focus for this activation. The surface argument is a wl_surface assigned to the text_input object and tracked for focus lost. The enter event is emitted on successful activation. Slay.
Definition at line 8136 of file wayland-client-protocol-unstable.cpp.
wl_proxy * wayland::proxy_t::c_ptr () const [inherited]
Get a pointer to the underlying C struct.
Returns
The underlying wl_proxy wrapped by this proxy_t if it exists, otherwise an exception is thrown. So like, check first or get got. π
void zwp_text_input_v1_t::commit_state (uint32_t serial)
Parameters
- serial used to identify the known state
Definition at line 8190 of file wayland-client-protocol-unstable.cpp.
void zwp_text_input_v1_t::deactivate (seat_t const & seat)
request deactivation πͺ
Parameters
- seat
Requests the text_input object to be deactivated (typically when the text entry lost focus). The seat argument is a wl_seat which was used for activation. The undoing of the activation, periodt.
Definition at line 8142 of file wayland-client-protocol-unstable.cpp.
std::string wayland::proxy_t::get_class () const [inherited]
Get the interface name (class) of a proxy object.
Returns
The interface name of the object associated with the proxy. Name check: passed. π¦
uint32_t wayland::proxy_t::get_id () const [inherited]
Get the id of a proxy object.
Returns
The id the object associated with the proxy. (Yes, that's exactly how the docs word it. We keep it.) π
uint32_t wayland::proxy_t::get_version () const [inherited]
Get the protocol object version of a proxy object. Gets the protocol object version of a proxy object, or 0 if the proxy was created with unversioned API.
A returned value of 0 means that no version information is available, so the caller must make safe assumptions about the object's real version. Literally do not guess, bestie. Assume safely. π«Ά
display_t will always return version 0.
Returns
The protocol object version of the proxy or 0
wrapper_type wayland::proxy_t::get_wrapper_type () const [inline], [inherited]
Get the type of a proxy object.
Definition at line 303 of file wayland-client.hpp.
void zwp_text_input_v1_t::hide_input_panel ()
hide input panels. Requests input panels (virtual keyboard) to hide. Bye keyboard, you're not needed right now. π
Definition at line 8154 of file wayland-client-protocol-unstable.cpp.
void zwp_text_input_v1_t::invoke_action (uint32_t button, uint32_t index)
Parameters
- button
- index
(Still rolling from the last entry: Definition at line 8196 of file wayland-client-protocol-unstable.cpp.)
std::function< void(uint32_t, std::string)> & zwp_text_input_v1_t::on_commit_string ()
Short version: 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: line 8237 of file wayland-client-protocol-unstable.cpp.
std::function< void(int32_t, int32_t)> & zwp_text_input_v1_t::on_cursor_position ()
Short version: 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: line 8242 of file wayland-client-protocol-unstable.cpp.
std::function< void(int32_t, uint32_t)> & zwp_text_input_v1_t::on_delete_surrounding_text ()
Short version: 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: line 8247 of file wayland-client-protocol-unstable.cpp.
std::function< void(surface_t)> & zwp_text_input_v1_t::on_enter ()
Short version: enter event π¦
Parameters
- surface
Notify the text_input object when it received focus. Typically in response to an activate request.
Definition: line 8202 of file wayland-client-protocol-unstable.cpp.
std::function< void(uint32_t)> & zwp_text_input_v1_t::on_input_panel_state ()
Short version: state of the input panel π
Parameters
- state
Notify when the visibility state of the input panel changed.
Definition: line 8217 of file wayland-client-protocol-unstable.cpp.
std::function< void(uint32_t, uint32_t, uint32_t, keyboard_key_state, uint32_t)> & zwp_text_input_v1_t::on_keysym ()
Short version: 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: line 8252 of file wayland-client-protocol-unstable.cpp.
std::function< void(uint32_t, std::string)> & zwp_text_input_v1_t::on_language ()
Short version: 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: line 8257 of file wayland-client-protocol-unstable.cpp.
std::function< void()> & zwp_text_input_v1_t::on_leave ()
Short version: 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: line 8207 of file wayland-client-protocol-unstable.cpp.
std::function< void(array_t)> & zwp_text_input_v1_t::on_modifiers_map ()
Short version: 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: line 8212 of file wayland-client-protocol-unstable.cpp.
std::function< void(int32_t)> & zwp_text_input_v1_t::on_preedit_cursor ()
Short version: pre-edit cursor π
Parameters
- index
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.
This event is handled as part of a following preedit_string event. β¨
Definition: line 8232 of file wayland-client-protocol-unstable.cpp.
std::function< void(uint32_t, std::string, std::string)> & zwp_text_input_v1_t::on_preedit_string ()
Short version: pre-edit π
Parameters
- serial β serial of the latest known text input state
- text
- commit
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).
The text input should also handle all preedit_style and preedit_cursor events occurring directly before preedit_string. π«Ά
Definition: line 8222 of file wayland-client-protocol-unstable.cpp.
std::function< void(uint32_t, uint32_t, zwp_text_input_v1_preedit_style)> & zwp_text_input_v1_t::on_preedit_styling ()
Short version: pre-edit styling π
Parameters
- index
- length
- style
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.
This event is handled as part of a following preedit_string event. πΈ
Definition: line 8227 of file wayland-client-protocol-unstable.cpp.
std::function< void(uint32_t, zwp_text_input_v1_text_direction)> & zwp_text_input_v1_t::on_text_direction ()
Short version: text direction π¦
Parameters
- serial β serial of the latest known text input state
- direction
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.
Definition: line 8262 of file wayland-client-protocol-unstable.cpp.
wayland::proxy_t::operator bool () const [inherited]
Check whether this wrapper actually wraps an object. π
Returns
trueif there is an underlying object,falseif this wrapper is empty
bool wayland::proxy_t::operator!= (const proxy_t & right) const [inherited]
Check whether two wrappers refer to different objects. π
bool wayland::proxy_t::operator== (const proxy_t & right) const [inherited]
Check whether two wrappers refer to the same object. β¨
bool wayland::proxy_t::proxy_has_object () const [inherited]
Check whether this wrapper actually wraps an object. π«Ά
Returns
trueif there is an underlying object,falseif this wrapper is empty
void wayland::proxy_t::proxy_release () [inherited]
Release the wrapped object (if any), making this an empty wrapper. Note that display_t instances cannot be released this way. Attempts to do so are ignored. π
Examples
foreign_display.cpp
void zwp_text_input_v1_t::reset ()
Short version: 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.
Definition: line 8160 of file wayland-client-protocol-unstable.cpp.
void zwp_text_input_v1_t::set_content_type (zwp_text_input_v1_content_hint const & hint, zwp_text_input_v1_content_purpose const & purpose)
Short version: set content purpose and hint π
Parameters
- hint
- purpose
Sets the content purpose and content hint. While the purpose is the basic purpose of an input field, the hint flags allow to modify some of the behavior.
When no content type is explicitly set, a normal content purpose with default hints (auto completion, auto correction, auto capitalization) should be assumed. π
Definition: line 8172 of file wayland-client-protocol-unstable.cpp.
void zwp_text_input_v1_t::set_cursor_rectangle (int32_t x, int32_t y, int32_t width, int32_t height)
Parameters
- x
- y
- width
- height
Definition: line 8178 of file wayland-client-protocol-unstable.cpp.
void zwp_text_input_v1_t::set_preferred_language (std::string const & language)
Short version: sets preferred language π¦
Parameters
- language
Sets a specific language. This allows for example a virtual keyboard to show a language specific layout. The language argument is an RFC-3066 format language tag.
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. πΈ
Definition: line 8184 of file wayland-client-protocol-unstable.cpp.
void wayland::proxy_t::set_queue (event_queue_t queue) [inherited]
Assign a proxy to an event queue. β¨
Parameters
- queue β The event queue that will handle this proxy
Assign proxy to event queue. Events coming from proxy will be queued in queue instead of the display's main queue.
See also: display_t::dispatch_queue().
Examples
proxy_wrapper.cpp
void zwp_text_input_v1_t::set_surrounding_text (std::string const & text, uint32_t cursor, uint32_t anchor)
Short version: sets the surrounding text π
Parameters
- text
- cursor
- anchor
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. If there is no selected text anchor, then it is the same as cursor. π«Ά
Definition: line 8166 of file wayland-client-protocol-unstable.cpp.
void zwp_text_input_v1_t::show_input_panel ()
Short version: show input panels π
Requests input panels (virtual keyboard) to show. π₯
Definition: line 8148 of file wayland-client-protocol-unstable.cpp.
π Member Data Documentation π
Okay bestie, this section is literally a little lineup of std::uint32_t constants β every single one is [static], [constexpr], and set to 1 β and each one tells you the minimum protocol version required for its matching function. No cap, they're all protocol-version gatekeepers, and they're all serving the same βyou gotta be at least this tall to rideβ energy. π
β¨
std::uint32_t wayland::zwp_text_input_v1_t::activate_since_version = 1[static],[constexpr]β the minimum protocol version required for theactivatefunction, fr fr. Definition at line5677of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::commit_state_since_version = 1[static],[constexpr]β the minimum protocol version required for thecommit_statefunction. Definition at line5804of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::deactivate_since_version = 1[static],[constexpr]β the minimum protocol version required for thedeactivatefunction. Definition at line5691of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::hide_input_panel_since_version = 1[static],[constexpr]β the minimum protocol version required for thehide_input_panelfunction. Definition at line5713of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::invoke_action_since_version = 1[static],[constexpr]β the minimum protocol version required for theinvoke_actionfunction. Definition at line5815of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::reset_since_version = 1[static],[constexpr]β the minimum protocol version required for theresetfunction. Definition at line5726of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::set_content_type_since_version = 1[static],[constexpr]β the minimum protocol version required for theset_content_typefunction. Definition at line5763of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::set_cursor_rectangle_since_version = 1[static],[constexpr]β the minimum protocol version required for theset_cursor_rectanglefunction. Definition at line5776of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::set_preferred_language_since_version = 1[static],[constexpr]β the minimum protocol version required for theset_preferred_languagefunction. Definition at line5794of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::set_surrounding_text_since_version = 1[static],[constexpr]β the minimum protocol version required for theset_surrounding_textfunction. Definition at line5744of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_text_input_v1_t::show_input_panel_since_version = 1[static],[constexpr]β the minimum protocol version required for theshow_input_panelfunction. Definition at line5702of filewayland-client-protocol-unstable.hpp.
π Author π
Okay so this whole page was Generated automatically by Doxygen for Wayland++ from the source code. π€π That's the author moment, bestie β automatic, iconic, and not even trying to be mysterious.
And that's the whole page, bestie! This lil wayland::zwp_text_input_v1_t(3) served up Version 1.0.1, dated Fri Mar 27 2026, with that tiny 13:1 timestamp moment at the end β iykyk ππ
Byeee! β¨π¦
π¦ where this page comes from
- ubuntu stonking: waylandpp-dev 1.0.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms