map: allow creating mappings with no modifiers

This commit is contained in:
Isaac Freund 2020-06-05 10:54:39 +02:00
parent 321157bde3
commit 2b10720366
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11
2 changed files with 5 additions and 1 deletions

View file

@ -156,6 +156,9 @@ for a list of special key names.
.I command .I command
can be any of the above commands. can be any of the above commands.
A mapping without modifiers can be created by passing an empty string as the
modifiers argument.
.SH EXAMPLES .SH EXAMPLES
Bind bemenu-run to Super+P: Bind bemenu-run to Super+P:

View file

@ -27,6 +27,7 @@ const modifier_names = [_]struct {
name: []const u8, name: []const u8,
modifier: u32, modifier: u32,
}{ }{
.{ .name = "", .modifier = 0 },
.{ .name = "Shift", .modifier = c.WLR_MODIFIER_SHIFT }, .{ .name = "Shift", .modifier = c.WLR_MODIFIER_SHIFT },
.{ .name = "Lock", .modifier = c.WLR_MODIFIER_CAPS }, .{ .name = "Lock", .modifier = c.WLR_MODIFIER_CAPS },
.{ .name = "Control", .modifier = c.WLR_MODIFIER_CTRL }, .{ .name = "Control", .modifier = c.WLR_MODIFIER_CTRL },
@ -40,7 +41,7 @@ const modifier_names = [_]struct {
/// Create a new mapping for a given mode /// Create a new mapping for a given mode
/// ///
/// Example: /// Example:
/// map normal Mod4|Shift Return spawn alacritty /// map normal Mod4+Shift Return spawn alacritty
pub fn map( pub fn map(
allocator: *std.mem.Allocator, allocator: *std.mem.Allocator,
seat: *Seat, seat: *Seat,