refactor: move KeyEvent to input module
This commit is contained in:
parent
5d381dcc7b
commit
a8826b5067
5 changed files with 16 additions and 17 deletions
|
@ -1,14 +0,0 @@
|
|||
const std = @import("std");
|
||||
const input = @import("input");
|
||||
|
||||
event: input.Event = input.event.press,
|
||||
key: input.Key = 0,
|
||||
modifiers: input.Mods = 0,
|
||||
|
||||
pub fn eql(self: @This(), other: @This()) bool {
|
||||
return std.meta.eql(self, other);
|
||||
}
|
||||
|
||||
pub fn format(self: @This(), comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
try writer.print("{}:{}{}", .{ input.event_fmt(self.event), input.mod_fmt(self.modifiers), input.key_fmt(self.key) });
|
||||
}
|
|
@ -11,8 +11,8 @@ const log = @import("log");
|
|||
const input = @import("input");
|
||||
const command = @import("command");
|
||||
const EventHandler = @import("EventHandler");
|
||||
const KeyEvent = input.KeyEvent;
|
||||
|
||||
const KeyEvent = @import("KeyEvent.zig");
|
||||
const parse_flow = @import("parse_flow.zig");
|
||||
const parse_vim = @import("parse_vim.zig");
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const std = @import("std");
|
||||
const input = @import("input");
|
||||
const KeyEvent = @import("KeyEvent.zig");
|
||||
|
||||
pub const ParseError = error{
|
||||
OutOfMemory,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const std = @import("std");
|
||||
const input = @import("input");
|
||||
const KeyEvent = @import("KeyEvent.zig");
|
||||
|
||||
fn peek(str: []const u8, i: usize) error{OutOfBounds}!u8 {
|
||||
if (i + 1 < str.len) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue