Merge pull request #287 from ZystemOS/remote-kbd-test-code

Remove keyboard test code
This commit is contained in:
Sam Tebbs 2021-01-25 17:44:16 +00:00 committed by GitHub
commit b433dee288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,31 +192,6 @@ fn initStage2() noreturn {
else => {},
}
const kb = keyboard.getKeyboard(0) orelse unreachable;
var shift = false;
while (true) {
if (kb.readKey()) |key| {
if (key.released) {
if (key.position == keyboard.KeyPosition.LEFT_SHIFT) {
shift = false;
}
continue;
}
var char: ?u8 = switch (key.position) {
keyboard.KeyPosition.LEFT_SHIFT, keyboard.KeyPosition.RIGHT_SHIFT => blk: {
shift = true;
break :blk null;
},
keyboard.KeyPosition.Q => if (shift) @as(u8, 'Q') else @as(u8, 'q'),
keyboard.KeyPosition.W => if (shift) @as(u8, 'W') else @as(u8, 'w'),
else => null,
};
if (char) |ch| {
tty.print("{c}", .{ch});
}
}
}
// Can't return for now, later this can return maybe
arch.spinWait();
}