X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=docs%2Fkeyboard.txt;fp=docs%2Fkeyboard.txt;h=afa44825b132c0bfc56bad8bdaf81bde5714fa90;hp=0000000000000000000000000000000000000000;hb=19bb0a4e64c9ab3e62ff4bbd959289704ee5b8f1;hpb=0a6b0889c67675bd71681ec41774d2ea57ce5335 diff --git a/docs/keyboard.txt b/docs/keyboard.txt new file mode 100644 index 0000000..afa4482 --- /dev/null +++ b/docs/keyboard.txt @@ -0,0 +1,31 @@ +Name: Generic Keyboard (compatible) +ID: 0x30cf7406 +Version: 1 + +Interrupts do different things depending on contents of the A register: + + A | BEHAVIOR +---+---------------------------------------------------------------------------- + 0 | Clear keyboard buffer + 1 | Store next key typed in C register, or 0 if the buffer is empty + 2 | Set C register to 1 if the key specified by the B register is pressed, or + | 0 if it's not pressed + 3 | If register B is non-zero, turn on interrupts with message B. If B is zero, + | disable interrupts +---+---------------------------------------------------------------------------- + +When interrupts are enabled, the keyboard will trigger an interrupt when one or +more keys have been pressed, released, or typed. + +Key numbers are: + 0x10: Backspace + 0x11: Return + 0x12: Insert + 0x13: Delete + 0x20-0x7f: ASCII characters + 0x80: Arrow up + 0x81: Arrow down + 0x82: Arrow left + 0x83: Arrow right + 0x90: Shift + 0x91: Control