We're looking for your comments on how to best organize the wiki's content.
Generic keyboard
From 0x10c Wiki
The Generic Keyboard is a simple input device compatible with the DCPU-16. It outputs all the 7-bit, printable ASCII characters, as well as other, non-ASCII key codes (see below).
Contents |
[edit] Hardware details
| Name | Generic Keyboard |
| ID | 0x30cf7406 |
| Version | 1 |
| Manufacturer | Unknown |
[edit] Interrupts
The Generic Keyboard can perform four interrupts depending on the value of the A register:
| A | Behavior |
|---|---|
| 0 | Clears keyboard buffer. |
| 1 | Store the ASCII value of the key in the keyboard buffer to the C register, or 0 if the buffer is empty. |
| 2 | Sets the C register to 0x1 if the key specified by the B register is pressed, or to zero if it not pressed. |
| 3 | Turns on interrupts with the message specified by the B register, if B is zero it turns off the interrupts. |
When interrupts are enabled, the keyboard will trigger an interrupt when one or more keys have been pressed, released, or typed.
[edit] Key values
The Generic Keyboard uses a modified ASCII character set. While the printable characters (aside from return) are the same as in 7-bit ASCII, other keys have non-ASCII key codes:
| Key | Hexadecimal value |
|---|---|
| Backspace | 0x10 |
| Return | 0x11 |
| Insert | 0x12 |
| Delete | 0x13 |
| ASCII characters | 0x20 to 0x7F |
| Arrow up | 0x80 |
| Arrow down | 0x81 |
| Arrow left | 0x82 |
| Arrow right | 0x83 |
| Shift | 0x90 |
| Control | 0x91 |
[edit] External Links and References
- Official specification document: http://dcpu.com/keyboard/
| ||||||||

