From 62abfc5ee508a4b4186b120619c7f428ed95fa43 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 1 Jun 2020 15:16:18 +0200 Subject: Rename bind -> map --- src/Seat.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Seat.zig') diff --git a/src/Seat.zig b/src/Seat.zig index 22388d1..82979fc 100644 --- a/src/Seat.zig +++ b/src/Seat.zig @@ -45,7 +45,7 @@ cursor: Cursor, /// Mulitple keyboards are handled separately keyboards: std.TailQueue(Keyboard), -/// Id of the current keybind mode +/// ID of the current keymap mode mode_id: usize, /// Currently focused output, may be the noop output if no @@ -246,16 +246,16 @@ pub fn handleViewUnmap(self: *Self, view: *View) void { } } -/// Handle any user-defined keybinding for the passed keysym and modifiers +/// Handle any user-defined mapping for the passed keysym and modifiers /// Returns true if the key was handled -pub fn handleKeybinding(self: *Self, keysym: c.xkb_keysym_t, modifiers: u32) bool { +pub fn handleMapping(self: *Self, keysym: c.xkb_keysym_t, modifiers: u32) bool { const modes = &self.input_manager.server.config.modes; - for (modes.items[self.mode_id].items) |keybind| { - if (modifiers == keybind.modifiers and keysym == keybind.keysym) { + for (modes.items[self.mode_id].items) |mapping| { + if (modifiers == mapping.modifiers and keysym == mapping.keysym) { // Execute the bound command const allocator = self.input_manager.server.allocator; var failure_message: []const u8 = undefined; - command.run(allocator, self, keybind.command_args, &failure_message) catch |err| { + command.run(allocator, self, mapping.command_args, &failure_message) catch |err| { // TODO: log the error if (err == command.Error.CommandFailed) allocator.free(failure_message); -- cgit v1.2.3