Skip to content

Commit

Permalink
Merge pull request #39 from kentucky-fried-kernel/feat/rebootescape
Browse files Browse the repository at this point in the history
add: reboot on escape
  • Loading branch information
FelixBrgm authored Feb 2, 2025
2 parents 0791ce3 + 6bef67b commit d0f7b3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ pub fn launch(s: &mut Screen) {
s.handle_key(key);
}
}
Key::Escape => {
reboot_cmd(&[], s);
}
_ => s.handle_key(key),
}
flush(s);
Expand Down
3 changes: 2 additions & 1 deletion src/terminal/ps2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ unsafe fn read(port: u16) -> u8 {
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, PartialOrd)]
pub enum Key {
Escape,
Tab,
Enter,
ArrowUp,
Expand Down Expand Up @@ -125,7 +126,7 @@ use Key::*;
/// Conversion table for all characters currently supported by our kernel for PS2 input.
const SCANCODE_TO_KEY: [Option<Key>; 256] = [
None,
None,
Some(Escape),
Some(N1),
Some(N2),
Some(N3),
Expand Down

0 comments on commit d0f7b3e

Please sign in to comment.