Skip to content

Commit

Permalink
command/map: add Alt/Super as aliases for Mod1/Mod4
Browse files Browse the repository at this point in the history
I personally made the mistake of using Alt instead of Mod1 when messing
with my config. This change makes things a bit more user
friendly/intuitive.
  • Loading branch information
ifreund committed Jan 17, 2022
1 parent 0bdf348 commit f79c784
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions doc/riverctl.1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,17 @@ is active. It cannot be entered or exited manually.
The following modifiers are available for use in mappings:

- Shift
- Lock (Caps lock)
- Control (Ctrl)
- Lock
- Control
- Mod1 (Alt)
- Mod2
- Mod3
- Mod4 (Super, Logo, Windows)
- Mod4 (Super)
- Mod5
- None (Create a mapping without modifiers)
- None

Alt and Super are aliases for Mod1 and Mod4 respectively. None allows creating
a mapping without modifiers

Keys are specified by their XKB keysym name. See
_/usr/include/xkbcommon/xkbcommon-keysyms.h_ for the complete list.
Expand Down
2 changes: 2 additions & 0 deletions river/command/map.zig
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ fn parseModifiers(
.{ .name = "Lock", .field_name = "caps" },
.{ .name = "Control", .field_name = "ctrl" },
.{ .name = "Mod1", .field_name = "alt" },
.{ .name = "Alt", .field_name = "alt" },
.{ .name = "Mod2", .field_name = "mod2" },
.{ .name = "Mod3", .field_name = "mod3" },
.{ .name = "Mod4", .field_name = "logo" },
.{ .name = "Super", .field_name = "logo" },
.{ .name = "Mod5", .field_name = "mod5" },
}) |def| {
if (std.mem.eql(u8, def.name, mod_name)) {
Expand Down

0 comments on commit f79c784

Please sign in to comment.