diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2019-05-26 19:28:27 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2019-05-26 19:28:27 +0100 |
| commit | bd77381c27ef5b61bf1c123efef3895b98a7a615 (patch) | |
| tree | ba798b442305ad4e174d79cf5bb7a822b7e1e2e9 /os/shell/shell.c | |
| parent | eb4de24523e8f0832daae89a083844c8e9a261e9 (diff) | |
| download | tinyOS-bd77381c27ef5b61bf1c123efef3895b98a7a615.tar.xz tinyOS-bd77381c27ef5b61bf1c123efef3895b98a7a615.zip | |
Proxy keypress from kernel to focused program
Diffstat (limited to 'os/shell/shell.c')
| -rw-r--r-- | os/shell/shell.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/os/shell/shell.c b/os/shell/shell.c new file mode 100644 index 0000000..933b19c --- /dev/null +++ b/os/shell/shell.c @@ -0,0 +1,23 @@ +#include "../../os/main.h" +#include "../../kernel/gpu/text_mode/display.h" + +void keypress_handler(unsigned char key) { + switch(key) + { + case '\b': + scrn_backspace(); + break; + case '\n': + scrn_newline(); + break; + default: + scrn_putchar(key); + } +} + +Program_t shell_run() { + Program_t this; + this.keypress_handler = keypress_handler; + this.name = "shell"; + return this; +}
\ No newline at end of file |