Keyboard: delete some uneeded code
This commit is contained in:
parent
913770975b
commit
393bfb42b9
@ -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);
|
||||
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user