treeland_keyboard_state_notify_unstable_v1 ↗
Copyright
SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. SPDX-License-Identifier: MIT
- treeland_keyboard_state_notify_manager_v1 — global keyboard state notification manager
- treeland_keyboard_state_watcher_v1 — keyboard state watcher
global keyboard state notification
This protocol allows privileged clients to subscribe to global keyboard state changes (e.g. Caps Lock, Num Lock).
Clients create watcher objects through the manager global, each bound to a seat. The client then configures the watcher with set_modifiers to choose which modifiers to monitor, and set_flags to choose which event types (locked, unlocked, or both) to receive. Configuration changes are double-buffered and take effect atomically when the client sends apply. Both set_modifiers and set_flags can be called multiple times before apply; only the values from the most recent calls are committed. This allows changing the configuration at runtime without destroying and recreating the watcher. After apply, the compositor sends a current_state event for each watched modifier containing its current lock state, so the client can synchronize its initial state without waiting for the next physical key press. The compositor then sends state_changed events on the watcher whenever any of the watched modifiers changes lock state globally, regardless of which surface has keyboard focus.
This protocol is observation-only. Keyboard state changes are never consumed or intercepted by this protocol.
Warning! This protocol is EXPERIMENTAL and under active development. It may change at any time, including in backward-incompatible ways, without incrementing the interface major version and without prior notice. No compatibility guarantees of any kind are provided. Clients and compositors must track the upstream definition in treeland-protocols and must not rely on the current interface names, requests, events, or semantics remaining stable across releases.
treeland_keyboard_state_notify_unstable_v1
treeland_keyboard_state_notify_manager_v1
- destroy — destroy the keyboard state notify manager
- get_keyboard_state_watcher — create a keyboard state watcher object
global keyboard state notification manager
The treeland_keyboard_state_notify_manager_v1 interface is a singleton global object used to create watcher objects for monitoring keyboard state changes on a given seat.
A client may create multiple watcher objects for the same seat if needed.
treeland_keyboard_state_notify_unstable_v1
treeland_keyboard_state_watcher_v1
- modifier — keyboard modifier type
- watch_flag — modifier state transition flags
- modifier_state — modifier lock state
- destroy — destroy the keyboard state watcher
- set_modifiers — set the modifiers to watch
- set_flags — change which state transitions to notify about
- apply — apply pending configuration changes
- current_state — current state of a watched modifier
- state_changed — a watched modifier has changed state
keyboard state watcher
The treeland_keyboard_state_watcher_v1 interface represents a subscription to keyboard state changes on a specific seat.
This object is created via get_keyboard_state_watcher on the treeland_keyboard_state_notify_manager_v1 global. The client configures the watcher with set_modifiers to choose which modifiers to monitor and set_flags to choose which state transitions to receive. Both can be changed at runtime. Configuration changes are double-buffered: set_modifiers and set_flags only update the pending state, which is applied atomically when apply is called.
The compositor sends a current_state event for each modifier in the committed modifier set immediately after apply is called. It then sends state_changed events whenever any of the watched modifiers changes lock state, according to the committed modifiers and flags.