1
0
Fork 0
forked from wry/wry

config: allow consuming/forwarding key events

This commit is contained in:
Julian Orth 2024-04-15 18:42:59 +02:00
parent 6ee4fdb9f4
commit 18bc86d14f
12 changed files with 106 additions and 13 deletions

View file

@ -335,6 +335,26 @@ impl Seat {
pub fn move_to_output(self, connector: Connector) {
get!().move_to_output(WorkspaceSource::Seat(self), connector);
}
/// Set whether the current key event is forwarded to the focused client.
///
/// This only has an effect if called from a keyboard shortcut.
///
/// By default, release events are forwarded and press events are consumed. Note that
/// consuming release events can cause clients to get stuck in the pressed state.
pub fn set_forward(self, forward: bool) {
get!().set_forward(self, forward);
}
/// This is a shorthand for `set_forward(true)`.
pub fn forward(self) {
self.set_forward(true)
}
/// This is a shorthand for `set_forward(false)`.
pub fn consume(self) {
self.set_forward(false)
}
}
/// Returns all seats.