╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────╮ │ 4 const xitui = xit.xitui; │ │ 5 const wgt = xitui.widget; │ │ 6 const layout = xitui.layout; │ │ 7 -const inp = xitui.input; │ │ 7 +const Key = xitui.input.Key; │ │ 8 const Grid = xitui.grid.Grid; │ │ 9 const Focus = xitui.focus.Focus; │ │10 +const inp = @import("./input.zig"); │ │11 const evt = @import("../event.zig"); │ │12 │ │13 pub const Users = @import("./Home/Users.zig");│ ╰──────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │139 try self.box.build(allocator, constraint, root_focus); │ │140 } │ │141 │ │141 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │142 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │143 if (self.getFocus().child_id) |child_id| { │ │144 if (self.box.children.getIndex(child_id)) |current_index| { │ │145 const child = &self.box.children.values()[current_index].widget; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │146 var index = current_index; │ │147 │ │147 - const Direction = enum { up, down, none }; │ │148 - const direction: Direction = switch (key) { │ │149 - .arrow_up => .up, │ │150 - .arrow_down => .down, │ │151 - .mouse => |mouse| if (mouse.action == .scroll) │ │152 - (if (mouse.action.scroll == .up) .up else .down)│ │153 - else │ │154 - .none, │ │155 - else => .none, │ │156 - }; │ │148 + const direction = inp.vertDirection(key); │ │149 │ │150 switch (direction) { │ │151 .up => { │ ╰─────────────────────────────────────────────────────────────────────────────╯