Allow "None" as modifier string for bindings without modifiers

This is more userfriendly than the empty string approach.
This commit is contained in:
Leon Henrik Plickat 2020-10-18 02:47:48 +02:00 committed by Isaac Freund
parent ec5d5e8826
commit 4b4f7c464c
2 changed files with 2 additions and 3 deletions

View File

@ -153,8 +153,7 @@ that tag 1 through 9 are visible.
_key_ is an XKB key name. See _/usr/include/xkbcommon/xkbcommon-keysyms.h_ _key_ is an XKB key name. See _/usr/include/xkbcommon/xkbcommon-keysyms.h_
for a list of special key names. _command_ can be any of the above commands. for a list of special key names. _command_ can be any of the above commands.
A mapping without modifiers can be created by passing an empty string as A mapping without modifiers can be created by using "None" as sole modifier.
the modifiers argument.
*map-pointer* _mode_ _modifiers_ _button_ _action_ *map-pointer* _mode_ _modifiers_ _button_ _action_
_mode_ and _modifiers_ are the same as for *map*. _mode_ and _modifiers_ are the same as for *map*.

View File

@ -29,7 +29,7 @@ const modifier_names = [_]struct {
name: []const u8, name: []const u8,
modifier: u32, modifier: u32,
}{ }{
.{ .name = "", .modifier = 0 }, .{ .name = "None", .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 },