diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-06-01 15:16:18 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-06-01 15:16:18 +0200 |
| commit | 62abfc5ee508a4b4186b120619c7f428ed95fa43 (patch) | |
| tree | 0cd5f61cd8699404c664cc84388f942508e7fe69 /src/command | |
| parent | 70cc3185181109a43871b65771891ce3d733b0fe (diff) | |
| download | river-62abfc5ee508a4b4186b120619c7f428ed95fa43.tar.gz river-62abfc5ee508a4b4186b120619c7f428ed95fa43.tar.xz | |
Rename bind -> map
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/declare_mode.zig | 6 | ||||
| -rw-r--r-- | src/command/map.zig (renamed from src/command/bind.zig) | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/command/declare_mode.zig b/src/command/declare_mode.zig index 6cc1489..943ede8 100644 --- a/src/command/declare_mode.zig +++ b/src/command/declare_mode.zig @@ -20,10 +20,10 @@ const std = @import("std"); const c = @import("../c.zig"); const Error = @import("../command.zig").Error; -const Keybind = @import("../Keybind.zig"); +const Mapping = @import("../Mapping.zig"); const Seat = @import("../Seat.zig"); -/// Declare a new keybind mode +/// Declare a new keymap mode pub fn declareMode( allocator: *std.mem.Allocator, seat: *Seat, @@ -47,5 +47,5 @@ pub fn declareMode( try config.mode_to_id.putNoClobber(new_mode_name, config.modes.items.len); errdefer _ = config.mode_to_id.remove(new_mode_name); - try config.modes.append(std.ArrayList(Keybind).init(allocator)); + try config.modes.append(std.ArrayList(Mapping).init(allocator)); } diff --git a/src/command/bind.zig b/src/command/map.zig index f8571bc..90c0b33 100644 --- a/src/command/bind.zig +++ b/src/command/map.zig @@ -20,7 +20,7 @@ const std = @import("std"); const c = @import("../c.zig"); const Error = @import("../command.zig").Error; -const Keybind = @import("../Keybind.zig"); +const Mapping = @import("../Mapping.zig"); const Seat = @import("../Seat.zig"); const modifier_names = [_]struct { @@ -37,10 +37,11 @@ const modifier_names = [_]struct { .{ .name = "Mod5", .modifier = c.WLR_MODIFIER_MOD5 }, }; -/// Create a new keybind for a given mode +/// Create a new mapping for a given mode /// -/// bind normal Control|Shift|Mod4 Comma spawn alacritty -pub fn bind( +/// Example: +/// map normal Mod4|Shift Return spawn alacritty +pub fn map( allocator: *std.mem.Allocator, seat: *Seat, args: []const []const u8, @@ -54,7 +55,7 @@ pub fn bind( const mode_id = config.mode_to_id.getValue(target_mode) orelse { failure_message.* = try std.fmt.allocPrint( allocator, - "cannot add keybind to non-existant mode '{}'", + "cannot add mapping to non-existant mode '{}p'", .{target_mode}, ); return Error.CommandFailed; @@ -105,5 +106,5 @@ pub fn bind( } } - try mode_mappings.append(try Keybind.init(allocator, keysym, modifiers, args[4..])); + try mode_mappings.append(try Mapping.init(allocator, keysym, modifiers, args[4..])); } |
