refactor: remove unused mapPress function in move_to_char

This commit is contained in:
CJ van den Berg 2024-10-28 19:42:43 +01:00
parent d4d8ad4dd5
commit 0b6d820153
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -77,25 +77,6 @@ pub fn receive(_: *Self, _: tp.pid_ref, _: tp.message) error{Exit}!bool {
return false; return false;
} }
fn mapPress(self: *Self, keypress: u32, egc: u32, modifiers: u32) tp.result {
switch (keypress) {
key.LSUPER, key.RSUPER => return,
key.LSHIFT, key.RSHIFT => return,
key.LCTRL, key.RCTRL => return,
key.LALT, key.RALT => return,
else => {},
}
return switch (modifiers) {
mod.SHIFT => if (!key.synthesized_p(keypress)) self.execute_operation(egc) else self.cancel(),
0 => switch (keypress) {
key.ESC => self.cancel(),
key.ENTER => self.cancel(),
else => if (!key.synthesized_p(keypress)) self.execute_operation(egc) else self.cancel(),
},
else => self.cancel(),
};
}
fn execute_operation(self: *Self, c: u32) void { fn execute_operation(self: *Self, c: u32) void {
const cmd = switch (self.direction) { const cmd = switch (self.direction) {
.left => switch (self.operation) { .left => switch (self.operation) {