per keyboard repeat config

This commit is contained in:
rustysec 2024-06-01 06:05:16 -07:00 committed by rustysec
parent b12396d8a1
commit f76b3bb794

View File

@ -271,19 +271,24 @@ impl State {
fn on_keyboard<I: InputBackend>(&mut self, event: I::KeyboardKeyEvent) { fn on_keyboard<I: InputBackend>(&mut self, event: I::KeyboardKeyEvent) {
{ {
let device = event.device(); let device = event.device();
let xkb = self
let keyboard_config = self
.niri .niri
.config .config
.borrow() .borrow()
.input .input
.keyboard_named(device.name()) .keyboard_named(device.name());
.xkb;
let keyboard = self.niri.seat.get_keyboard().unwrap(); let keyboard = self.niri.seat.get_keyboard().unwrap();
if let Err(err) = keyboard.set_xkb_config(self, xkb.to_xkb_config()) { if let Err(err) = keyboard.set_xkb_config(self, keyboard_config.xkb.to_xkb_config()) {
warn!("error updating xkb config: {err:?}"); warn!("error updating xkb config: {err:?}");
} }
keyboard.change_repeat_info(
keyboard_config.repeat_rate.into(),
keyboard_config.repeat_delay.into(),
);
} }
let comp_mod = self.backend.mod_key(); let comp_mod = self.backend.mod_key();