Go to index / Go to protocols

virtual_keyboard_unstable_v1 ↗

virtual_keyboard_unstable_v1
zwp_virtual_keyboard_v1

Version 1

virtual keyboard

The virtual keyboard provides an application with requests which emulate the behaviour of a physical keyboard.

This interface can be used by clients on its own to provide raw input events, or it can accompany the input method protocol.

zwp_virtual_keyboard_v1
request keymap(
    format: uint,
    fd: fd,
    size: uint,
)
  • format — keymap format
  • fd — keymap file descriptor
  • size — keymap size, in bytes

keyboard mapping

Provide a file descriptor to the compositor which can be memory-mapped to provide a keyboard mapping description.

Format carries a value from the keymap_format enumeration.

zwp_virtual_keyboard_v1
enum error {
    no_keymap = 0,
}
  • no_keymap — No keymap was set
zwp_virtual_keyboard_v1
request key(
    time: uint,
    key: uint,
    state: uint,
)
  • time — timestamp with millisecond granularity
  • key — key that produced the event
  • state — physical state of the key

key event

A key was pressed or released. The time argument is a timestamp with millisecond granularity, with an undefined base. All requests regarding a single object must share the same clock.

Keymap must be set before issuing this request.

State carries a value from the key_state enumeration.

zwp_virtual_keyboard_v1
request modifiers(
    mods_depressed: uint,
    mods_latched: uint,
    mods_locked: uint,
    group: uint,
)
  • mods_depressed — depressed modifiers
  • mods_latched — latched modifiers
  • mods_locked — locked modifiers
  • group — keyboard layout

modifier and group state

Notifies the compositor that the modifier and/or group state has changed, and it should update state.

The client should use wl_keyboard.modifiers event to synchronize its internal state with seat state.

Keymap must be set before issuing this request.

zwp_virtual_keyboard_v1
request destroy()
DestructorAvailable since version 1

    destroy the virtual keyboard keyboard object

    virtual_keyboard_unstable_v1
    zwp_virtual_keyboard_manager_v1

    Version 1
    Compositor Support
    Version 1
    cage 0.3.0
    cosmic 1.0.0
    hyprland 0.52.1
    jay 1.14.0
    labwc 0.20.2
    mir 2.26
    niri 26.04
    phoc 0.55
    river 0.3.13
    sway 1.11
    treeland 0.8.0
    wayfire 0.9.0

    virtual keyboard manager

    A virtual keyboard manager allows an application to provide keyboard input events as if they came from a physical keyboard.

    zwp_virtual_keyboard_manager_v1
    enum error {
        unauthorized = 0,
    }
    • unauthorized — client not authorized to use the interface
    zwp_virtual_keyboard_manager_v1
    request create_virtual_keyboard(
        seat: object<wl_seat>,
        id: new_id<zwp_virtual_keyboard_v1>,
    )

      Create a new virtual keyboard

      Creates a new virtual keyboard associated to a seat.

      If the compositor enables a keyboard to perform arbitrary actions, it should present an error when an untrusted client requests a new keyboard.