diff --git a/river/Keyboard.zig b/river/Keyboard.zig index 2aaf6fb..97eae23 100644 --- a/river/Keyboard.zig +++ b/river/Keyboard.zig @@ -129,11 +129,8 @@ fn handleKey(listener: *wl.Listener(*wlr.Keyboard.event.Key), event: *wlr.Keyboa } }; - if (self.device.seat.hasMapping(keycode, modifiers, released, xkb_state)) { + if (self.device.seat.handleMapping(keycode, modifiers, released, xkb_state)) { if (!released) self.eaten_keycodes.add(event.keycode); - - const handled = self.device.seat.handleMapping(keycode, modifiers, released, xkb_state); - assert(handled); } else if (self.getInputMethodGrab()) |keyboard_grab| { if (!released) self.eaten_keycodes.add(event.keycode); diff --git a/river/Seat.zig b/river/Seat.zig index dc28b2f..5efd665 100644 --- a/river/Seat.zig +++ b/river/Seat.zig @@ -358,23 +358,6 @@ pub fn enterMode(self: *Self, mode_id: u32) void { } } -/// Is there a user-defined mapping for passed keycode, modifiers and keyboard state? -pub fn hasMapping( - self: *Self, - keycode: xkb.Keycode, - modifiers: wlr.Keyboard.ModifierMask, - released: bool, - xkb_state: *xkb.State, -) bool { - const modes = &server.config.modes; - for (modes.items[self.mode_id].mappings.items) |*mapping| { - if (mapping.match(keycode, modifiers, released, xkb_state)) { - return true; - } - } - return false; -} - /// Handle any user-defined mapping for passed keycode, modifiers and keyboard state /// Returns true if at least one mapping was run pub fn handleMapping(