╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │ 6 const xitui = xit.xitui; │ │ 7 const wgt = xitui.widget; │ │ 8 const layout = xitui.layout; │ │ 9 -const inp = xitui.input; │ │ 9 +const Key = xitui.input.Key; │ │10 const Grid = xitui.grid.Grid; │ │11 const Focus = xitui.focus.Focus; │ │12 +const inp = @import("./input.zig"); │ │13 │ │14 pub const Header = @import("./User/Header.zig");│ │15 pub const Settings = @import("./Settings.zig"); │ ╰────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │210 try self.box.build(allocator, constraint, root_focus); │ │211 } │ │212 │ │212 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │213 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │214 if (self.getFocus().child_id) |child_id| { │ │215 if (self.box.children.getIndex(child_id)) |current_index| { │ │216 const child = &self.box.children.values()[current_index].widget; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │217 var index = current_index; │ │218 │ │218 - const Direction = enum { up, down, none }; │ │219 - const direction: Direction = switch (key) { │ │220 - .arrow_up => .up, │ │221 - .arrow_down => .down, │ │222 - .mouse => |mouse| if (mouse.action == .scroll) │ │223 - (if (mouse.action.scroll == .up) .up else .down)│ │224 - else │ │225 - .none, │ │226 - else => .none, │ │227 - }; │ │219 + const direction = inp.vertDirection(key); │ │220 │ │221 switch (direction) { │ │222 .up => { │ ╰─────────────────────────────────────────────────────────────────────────────╯