wayland::zwp_i...d_context_v1_t(3)
π
wayland::zwp_i...d_context_v1_t(3) β Wayland++
okay bestie, welcome to the Wayland++ manual page for wayland::zwp_i...d_context_v1_t. this is part 1 of 3, and we are keeping every single detail β no cap. it's giving very specific protocol energy, and honestly? iconic. π
β¨ NAME β¨
wayland::zwp_input_method_context_v1_t β input method context. that's the name, bestie, and that's the vibe. π
πΈ SYNOPSIS πΈ
#include <wayland-client-protocol-unstable.hpp>
Inherits wayland::proxy_t. periodt. π«Ά
𧬠Public Types π§¬
enum class wrapper_type { standard, display, foreign, proxy_wrapper }
π οΈ Public Member Functions π οΈ
void commit_string (uint32_t serial, std::string const &text)β commit string. yes bestie, it commits the string. πvoid preedit_string (uint32_t serial, std::string const &text, std::string const &commit)β pre-edit string. the pre-edit-era main character. β¨void preedit_styling (uint32_t index, uint32_t length, zwp_text_input_v1_preedit_style const &style)β pre-edit styling. serving looks, literally. πvoid preedit_cursor (int32_t index)β pre-edit cursor. where the little cursor lives in pre-edit land. πvoid delete_surrounding_text (int32_t index, uint32_t length)β delete text. bye-bye surrounding text. π¦void cursor_position (int32_t index, int32_t anchor)β set cursor to a new position. move it, move it. πΈvoid modifiers_map (array_t const &map)β themodifiers_mapcall. no extra one-liner in the source, just the signature, iykyk. π«Άvoid keysym (uint32_t serial, uint32_t time, uint32_t sym, keyboard_key_state const &state, uint32_t modifiers)β keysym. keyboard lore. β¨οΈkeyboard_t grab_keyboard ()β grab hardware keyboard. highkey main character energy. πvoid key (uint32_t serial, uint32_t time, uint32_t key, keyboard_key_state const &state)β forward key event. sending it along. π₯void modifiers (uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)β forward modifiers event. all the mods, bestie. πvoid language (uint32_t serial, std::string const &language)β thelanguagecall. πvoid text_direction (uint32_t serial, uint32_t direction)β thetext_directioncall. βstd::function< void(std::string, uint32_t, uint32_t)> & on_surrounding_text ()β surrounding text event. πstd::function< void(zwp_text_input_v1_content_hint, zwp_text_input_v1_content_purpose)> & on_content_type ()β theon_content_typehandler. π§std::function< void(uint32_t, uint32_t)> & on_invoke_action ()β theon_invoke_actionhandler. π«std::function< void(uint32_t)> & on_commit_state ()β theon_commit_statehandler. πstd::function< void(std::string)> & on_preferred_language ()β theon_preferred_languagehandler. πΈuint32_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. same energy, different syntax. π«Άbool operator== (const proxy_t &right) constβ Check whether two wrappers refer to the same object. twins fr fr. π―bool operator!= (const proxy_t &right) constβ Check whether two wrappers refer to different objects. not twins. πvoid proxy_release ()β Release the wrapped object (if any), making this an empty wrapper. release the wrapper, bestie. ποΈ
π Static Public Attributes π
static constexpr std::uint32_t commit_string_since_version = 1β Minimum protocol version required for thecommit_stringfunction. πstatic constexpr std::uint32_t preedit_string_since_version = 1β Minimum protocol version required for thepreedit_stringfunction. πΈstatic constexpr std::uint32_t preedit_styling_since_version = 1β Minimum protocol version required for thepreedit_stylingfunction. πstatic constexpr std::uint32_t preedit_cursor_since_version = 1β Minimum protocol version required for thepreedit_cursorfunction. π¦static constexpr std::uint32_t delete_surrounding_text_since_version = 1β Minimum protocol version required for thedelete_surrounding_textfunction. β¨static constexpr std::uint32_t cursor_position_since_version = 1β Minimum protocol version required for thecursor_positionfunction. πstatic constexpr std::uint32_t modifiers_map_since_version = 1β Minimum protocol version required for themodifiers_mapfunction. π§static constexpr std::uint32_t keysym_since_version = 1β Minimum protocol version required for thekeysymfunction. β¨οΈstatic constexpr std::uint32_t grab_keyboard_since_version = 1β Minimum protocol version required for thegrab_keyboardfunction. πstatic constexpr std::uint32_t key_since_version = 1β Minimum protocol version required for thekeyfunction. π₯static constexpr std::uint32_t modifiers_since_version = 1β Minimum protocol version required for themodifiersfunction. πstatic constexpr std::uint32_t language_since_version = 1β Minimum protocol version required for thelanguagefunction. πstatic constexpr std::uint32_t text_direction_since_version = 1β Minimum protocol version required for thetext_directionfunction. β
π§ Detailed Description π§
input method context. that's the whole name, and honestly it ate.
so okay: this corresponds to a text input on the input method side. an input method context is created on text input activation on the input method side. it allows receiving information about the text input from the application via events. input method contexts do not keep state after deactivation and should be destroyed after deactivation is handled. that part is important, bestie β handle deactivation and then clean up. π
text is generally UTF-8 encoded, and indices and lengths are in bytes. not vibes, not characters β bytes. iykyk. π
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). literally a whole synchronization situation. π
β οΈ 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. so yeah β experimental protocol, bestie. read the warning, don't ignore the warning. π«Ά
Definition at line 705 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. π§¬
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. β οΈ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 π«
okay bestie, this is the big one β every single member function, in the order the page gives them. no skipping, no "you get the idea" β we're doing all of them because we're thorough like that π
c_ptr
wl_proxy * wayland::proxy_t::c_ptr () const [inherited]
Grab a pointer to the underlying C struct. yep, the actual raw thing under all the C++ wrapping π¦
Returns: the underlying wl_proxy wrapped by this proxy_t if it exists β and if it doesn't exist? an exception gets thrown. no vibes, just consequences π
commit_string
void zwp_input_method_context_v1_t::commit_string (uint32_t serial,
std::string const & text)
commit string β¨
Parameters:
serialβ serial of the latest known text input statetext
Send the commit string text for insertion to the application.
The text you commit could be just a single character after a key press, or the result of some composing (pre-edit). It could also be an empty text β like when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position).
heads up: any previously set composing text will be removed π
Definition at line 4543 of file wayland-client-protocol-unstable.cpp.
cursor_position
void zwp_input_method_context_v1_t::cursor_position (int32_t index, int32_t
anchor)
set cursor to a new position π―
Parameters:
indexanchor
Set the cursor and anchor to a new position. index is the new cursor position in bytes β when it's >= 0 that's relative to the end of the inserted text, otherwise it's relative to the beginning of the inserted text. anchor is the new anchor position in bytes β same deal, >= 0 means relative to the end of the inserted text, otherwise relative to the beginning of the inserted text. And when there should be no selected text, anchor should be the same as index. periodt β
This request will be handled on the text_input side directly following a commit_string request.
Definition at line 4573 of file wayland-client-protocol-unstable.cpp.
delete_surrounding_text
void zwp_input_method_context_v1_t::delete_surrounding_text (int32_t index,
uint32_t length)
delete text ποΈ
Parameters:
indexlength
Remove the surrounding text.
This request will be handled on the text_input side directly following a commit_string request.
Definition at line 4567 of file wayland-client-protocol-unstable.cpp.
get_class
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.
get_id
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 β¨
get_version
uint32_t wayland::proxy_t::get_version () const [inherited]
Get the protocol object version of a proxy object. It 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 there's no version information available, so the caller must make safe assumptions about the object's real version. no cap, that's on you to handle π
display_t will always return version 0.
Returns: the protocol object version of the proxy, or 0.
get_wrapper_type
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.
grab_keyboard
keyboard_t zwp_input_method_context_v1_t::grab_keyboard ()
grab hardware keyboard β¨οΈπ₯
Allow an input method to receive hardware keyboard input and process key events to generate text events (with pre-edit) over the wire. This is what lets input methods compose multiple key events for inputting text, the way it's done for CJK languages. iconic behavior honestly π
Definition at line 4591 of file wayland-client-protocol-unstable.cpp.
key
void zwp_input_method_context_v1_t::key (uint32_t serial, uint32_t time,
uint32_t key, keyboard_key_state const & state)
forward key event πΈ
Parameters:
serialβ serial fromwl_keyboard::keytimeβ time fromwl_keyboard::keykeyβ key fromwl_keyboard::keystateβ state fromwl_keyboard::key
Forward a wl_keyboard::key event to the client that was not processed by the input method itself. Should be used when filtering key events with grab_keyboard. The arguments should be the ones from the wl_keyboard::key event.
For generating custom key events use the keysym request instead. iykyk π
Definition at line 4598 of file wayland-client-protocol-unstable.cpp.
keysym
void zwp_input_method_context_v1_t::keysym (uint32_t serial, uint32_t time,
uint32_t sym, keyboard_key_state const & state, uint32_t modifiers)
keysym β
Parameters:
serialβ serial of the latest known text input statetimesymstatemodifiers
Notify when a key event was sent. Key events should not be used for normal text input operations β those 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 is a wl_keyboard key_state.
Definition at line 4585 of file wayland-client-protocol-unstable.cpp.
language
void zwp_input_method_context_v1_t::language (uint32_t serial, std::string
const & language)
Parameters:
serialβ serial of the latest known text input statelanguage
Definition at line 4610 of file wayland-client-protocol-unstable.cpp.
modifiers
void zwp_input_method_context_v1_t::modifiers (uint32_t serial, uint32_t
mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t
group)
forward modifiers event π
Parameters:
serialβ serial fromwl_keyboard::modifiersmods_depressedβ mods_depressed fromwl_keyboard::modifiersmods_latchedβ mods_latched fromwl_keyboard::modifiersmods_lockedβ mods_locked fromwl_keyboard::modifiersgroupβ group fromwl_keyboard::modifiers
Forward a wl_keyboard::modifiers event to the client that was not processed by the input method itself. Should be used when filtering key events with grab_keyboard. The arguments should be the ones from the wl_keyboard::modifiers event.
Definition at line 4604 of file wayland-client-protocol-unstable.cpp.
modifiers_map
void zwp_input_method_context_v1_t::modifiers_map (array_t const & map)
Parameters:
map
Definition at line 4579 of file wayland-client-protocol-unstable.cpp.
on_commit_state
std::function< void(uint32_t)> &
zwp_input_method_context_v1_t::on_commit_state ()
Parameters:
serialβ serial of text input state
Definition at line 4642 of file wayland-client-protocol-unstable.cpp.
on_content_type
std::function< void(zwp_text_input_v1_content_hint,
zwp_text_input_v1_content_purpose)> &
zwp_input_method_context_v1_t::on_content_type ()
Parameters:
hintpurpose
Definition at line 4632 of file wayland-client-protocol-unstable.cpp.
on_invoke_action
std::function< void(uint32_t, uint32_t)> &
zwp_input_method_context_v1_t::on_invoke_action ()
Parameters:
buttonindex
Definition at line 4637 of file wayland-client-protocol-unstable.cpp.
on_preferred_language
std::function< void(std::string)> &
zwp_input_method_context_v1_t::on_preferred_language ()
Parameters:
language
Definition at line 4647 of file wayland-client-protocol-unstable.cpp.
on_surrounding_text
std::function< void(std::string, uint32_t, uint32_t)> &
zwp_input_method_context_v1_t::on_surrounding_text ()
surrounding text event π
Parameters:
textcursoranchor
The plain surrounding text around the input position. cursor is the position in bytes within the surrounding text, relative to the beginning of the text. anchor is the position in bytes of the selection anchor within the surrounding text, relative to the beginning of the text. If there's no selected text then anchor is the same as cursor. easy π
Definition at line 4622 of file wayland-client-protocol-unstable.cpp.
operator bool
wayland::proxy_t::operator bool () const [inherited]
Check whether this wrapper actually wraps an object. the vibe check of wrappers, fr π«Ά
Returns: true if there's an underlying object, false if this wrapper is empty.
operator!=
bool wayland::proxy_t::operator!= (const proxy_t & right) const [inherited]
Check whether two wrappers refer to different objects.
operator==
bool wayland::proxy_t::operator== (const proxy_t & right) const [inherited]
Check whether two wrappers refer to the same object.
preedit_cursor
void zwp_input_method_context_v1_t::preedit_cursor (int32_t index)
pre-edit cursor π―
Parameters:
index
Set the cursor position inside the composing text (as a byte offset) relative to the start of the composing text.
When index is negative, no cursor should be displayed π
This request should be sent before sending a preedit_string request.
Definition at line 4561 of file wayland-client-protocol-unstable.cpp.
preedit_string
void zwp_input_method_context_v1_t::preedit_string (uint32_t serial,
std::string const & text, std::string const & commit)
pre-edit string β¨
Parameters:
serialβ serial of the latest known text input statetextcommit
Send the pre-edit string text to the application text input.
The commit text can be used to replace the pre-edit text on reset (for example on unfocus).
Previously sent preedit_style and preedit_cursor requests are also processed by the text_input. so like, they all show up together π¦
Definition at line 4549 of file wayland-client-protocol-unstable.cpp.
preedit_styling
void zwp_input_method_context_v1_t::preedit_styling (uint32_t index,
uint32_t length, zwp_text_input_v1_preedit_style const & style)
pre-edit styling π
Parameters:
indexlengthstyle
Set the styling information on composing text. The style is applied for length in bytes from index, relative to the beginning of the composing text (as a byte offset). Multiple styles can be applied to a composing text.
This request should be sent before sending a preedit_string request.
Definition at line 4555 of file wayland-client-protocol-unstable.cpp.
proxy_has_object
bool wayland::proxy_t::proxy_has_object () const [inherited]
Check whether this wrapper actually wraps an object. same energy as operator bool, different spelling π
Returns: true if there's an underlying object, false if this wrapper is empty.
proxy_release
void wayland::proxy_t::proxy_release () [inherited]
Release the wrapped object (if any), making this an empty wrapper.
ngl there's a catch: display_t instances cannot be released this way. attempts to do so are ignored. so don't even try it π
Examples: foreign_display.cpp.
set_queue
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.
text_direction
void zwp_input_method_context_v1_t::text_direction (uint32_t serial,
uint32_t direction)
Parameters:
serialβ serial of the latest known text input statedirection
Definition at line 4616 of file wayland-client-protocol-unstable.cpp.
π Member Data Documentation π
okay bestie so these are all the little static constexpr version constants β every single one of them is = 1, because this whole protocol landed in version 1 like an absolute icon. They're basically tiny bouncers at the club door checking "is your protocol version at least this?" before letting the function in π
std::uint32_twayland::zwp_input_method_context_v1_t::commit_string_since_version = 1β[static],[constexpr]β the minimum protocol version required for thecommit_stringfunction. Defined at line 752 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::cursor_position_since_version = 1β[static],[constexpr]β the minimum protocol version required for thecursor_positionfunction. Defined at line 846 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::delete_surrounding_text_since_version = 1β[static],[constexpr]β the minimum protocol version required for thedelete_surrounding_textfunction. Defined at line 824 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::grab_keyboard_since_version = 1β[static],[constexpr]β the minimum protocol version required for thegrab_keyboardfunction. Defined at line 889 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::key_since_version = 1β[static],[constexpr]β the minimum protocol version required for thekeyfunction. Defined at line 909 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::keysym_since_version = 1β[static],[constexpr]β the minimum protocol version required for thekeysymfunction. Defined at line 875 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::language_since_version = 1β[static],[constexpr]β the minimum protocol version required for thelanguagefunction. Defined at line 939 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::modifiers_map_since_version = 1β[static],[constexpr]β the minimum protocol version required for themodifiers_mapfunction. Defined at line 856 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::modifiers_since_version = 1β[static],[constexpr]β the minimum protocol version required for themodifiersfunction. Defined at line 928 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::preedit_cursor_since_version = 1β[static],[constexpr]β the minimum protocol version required for thepreedit_cursorfunction. Defined at line 808 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::preedit_string_since_version = 1β[static],[constexpr]β the minimum protocol version required for thepreedit_stringfunction. Defined at line 772 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::preedit_styling_since_version = 1β[static],[constexpr]β the minimum protocol version required for thepreedit_stylingfunction. Defined at line 791 of filewayland-client-protocol-unstable.hpp.std::uint32_t wayland::zwp_input_method_context_v1_t::text_direction_since_version = 1β[static],[constexpr]β the minimum protocol version required for thetext_directionfunction. Defined at line 950 of filewayland-client-protocol-unstable.hpp.
π«Ά lowkey obsessed with how every single one of these is 1 β consistent queen behavior, no notes.
π Author
Generated automatically by Doxygen for Wayland++ from the source code. like, the docs wrote themselves fr fr π€β¨
and that's a wrap on the whole page bestie!! π source + version check: this is Version 1.0.1, dated Fri Mar 27 2026, from the Wayland++ fam β go forth and vibe with your input method contexts ππ¦β¨
π¦ 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