ctrl-l is form feed

This commit is contained in:
Mitchell Hashimoto
2022-04-27 20:57:43 -07:00
parent 516e500b76
commit 53702343c2
2 changed files with 3 additions and 1 deletions

View File

@ -305,6 +305,8 @@ fn keyCallback(
//log.info("KEY {} {} {} {}", .{ key, scancode, mods, action }); //log.info("KEY {} {} {} {}", .{ key, scancode, mods, action });
if (action == .press or action == .repeat) { if (action == .press or action == .repeat) {
const c: u8 = switch (key) { const c: u8 = switch (key) {
// Ctrl-L form-feed
.l => if (mods.control) 0x0C else return,
.backspace => 0x08, .backspace => 0x08,
.enter => '\n', .enter => '\n',
else => return, else => return,

View File

@ -114,7 +114,7 @@ pub fn append(self: *Terminal, alloc: Allocator, str: []const u8) !void {
/// ///
/// This may allocate if necessary to store the character in the grid. /// This may allocate if necessary to store the character in the grid.
pub fn appendChar(self: *Terminal, alloc: Allocator, c: u8) !void { pub fn appendChar(self: *Terminal, alloc: Allocator, c: u8) !void {
log.debug("char: {}", .{c}); //log.debug("char: {}", .{c});
const actions = self.parser.next(c); const actions = self.parser.next(c);
for (actions) |action_opt| { for (actions) |action_opt| {
switch (action_opt orelse continue) { switch (action_opt orelse continue) {