Skip to content

Commit

Permalink
refactor: show modifiers of modifiers in input view
Browse files Browse the repository at this point in the history
  • Loading branch information
neurocyte committed Dec 20, 2024
1 parent 8dc7a42 commit 030b3cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tui/inputview.zig
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ pub fn listen(self: *Self, _: tp.pid_ref, m: tp.message) tp.result {
.modifiers = modifiers,
};
key_event.modifiers = switch (key_event.key) {
input.key.left_control, input.key.right_control => 0,
input.key.left_alt, input.key.right_alt => 0,
input.key.left_super, input.key.right_super => key_event.modifiers & ~input.mod.super,
input.key.left_shift, input.key.right_shift => key_event.modifiers & ~input.mod.shift,
input.key.left_control, input.key.right_control => key_event.modifiers & ~input.mod.ctrl,
input.key.left_alt, input.key.right_alt => key_event.modifiers & ~input.mod.alt,
else => key_event.modifiers,
};
writer.print(" -> {}", .{key_event}) catch |e| return tp.exit_error(e, @errorReturnTrace());
Expand Down

0 comments on commit 030b3cb

Please sign in to comment.