143cce94ee
Mu's keyboard handling is currently a bit of a mess, and this commit might be a bad idea. Ideally keyboards would return Unicode. Currently Mu returns single bytes. Mostly ASCII. No support for international keyboards yet. ASCII and Unicode have some keyboard scancodes grandfathered in, that don't really make sense for data transmission. Like backspace and delete. However, other keyboard scancodes don't have any place in Unicode. Including arrow keys. So Mu carves out an exception to Unicode for arrow keys. We'll place the arrow keys in a part of Unicode that is set aside for implementation-defined behavior (https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls): 0x80: left arrow 0x81: down arrow 0x82: up arrow 0x83: right arrow The order is same as hjkl for mnemonic convenience. I'd _really_ to follow someone else's cannibalization here. If I find one later, I'll switch to it. Applications that blindly assume the keyboard generates Unicode will have a bad time. Events like backspace, delete and arrow keys are intended to be processed early and should not be in text. With a little luck I won't need to modify this convention when I support international keyboards. |
||
---|---|---|
.. | ||
README.md | ||
cell.mu | ||
evaluate.mu | ||
gap-buffer.mu | ||
grapheme-stack.mu | ||
main.mu | ||
parse.mu | ||
print.mu | ||
read.mu | ||
sandbox.mu | ||
tokenize.mu | ||
trace.mu | ||
vimrc.vim |
README.md
A prototype shell for the Mu computer
Currently runs a tiny subset of Lisp. Steps to run it from the top-level:
- Build it:
$ ./translate shell/*.mu # generates disk.img
- Run it:
$ qemu-system-i386 disk.img
or:
$ bochs -f bochsrc
To save typing in a large s-expression, create a secondary disk for data:
$ dd if=/dev/zero of=data.img count=20160
Load an s-expression into it:
$ echo '(+ 1 1)' |dd of=data.img conv=notrunc
Now run with both code and data disks:
$ qemu-system-i386 -hda disk.img -hdb data.img
or:
$ bochs -f bochsrc.2disks
You can type in expressions, hit ctrl-s
to see their results, and hit Tab
to focus on the ...
below and browse how the results were computed. Here's
a demo. The bottom of
the screen shows context-dependent keyboard shortcuts (there's no mouse in the
Mu computer at the moment).
Known issues
-
There's no way to save to disk.
-
Don't press keys too quickly (such as by holding down a key). The Mu computer will crash (and often Qemu will segfault).