Keyboard: delete some uneeded code

This commit is contained in:
Isaac Freund 2024-01-05 12:31:55 -06:00
parent 913770975b
commit 393bfb42b9
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 1 additions and 21 deletions

View File

@ -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);

View File

@ -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(