autocommit 2022-03-30 18:10:37 CEST
This commit is contained in:
parent
c4854c4d7d
commit
a8136ed88c
17 changed files with 189 additions and 81 deletions
|
|
@ -4,13 +4,14 @@ use crate::_private::ipc::{ClientMessage, InitMessage, Response, ServerMessage};
|
|||
use crate::_private::{bincode_ops, logging, Config, ConfigEntry, ConfigEntryGen, VERSION};
|
||||
use crate::keyboard::keymap::Keymap;
|
||||
use crate::theme::Color;
|
||||
use crate::{Axis, Command, Direction, InputDevice, LogLevel, ModifiedKeySym, Seat};
|
||||
use crate::{Axis, Command, Direction, LogLevel, ModifiedKeySym, Seat};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use std::{ptr, slice};
|
||||
use crate::input::{Capability, InputDevice};
|
||||
|
||||
pub(crate) struct Client {
|
||||
configure: extern "C" fn(),
|
||||
|
|
@ -317,6 +318,17 @@ impl Client {
|
|||
self.send(&ClientMessage::SetSeat { device, seat })
|
||||
}
|
||||
|
||||
pub fn has_capability(&self, device: InputDevice, cap: Capability) -> bool {
|
||||
let res = self.with_response(|| self.send(&ClientMessage::HasCapability { device, cap }));
|
||||
match res {
|
||||
Response::HasCapability { has } => has,
|
||||
_ => {
|
||||
log::error!("Server did not send a response to a has_capability request");
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn seat_set_keymap(&self, seat: Seat, keymap: Keymap) {
|
||||
self.send(&ClientMessage::SeatSetKeymap { seat, keymap })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue