We're looking for your comments on how to best organize the wiki's content.
Generic keyboard
(Difference between revisions)
(Corrected 'of' to 'off') |
Isharacomix (Talk | contribs) |
||
| Line 78: | Line 78: | ||
| 0x91 | | 0x91 | ||
|} | |} | ||
| + | |||
| + | {{DCPU-16}} | ||
[[Category: Programming]] | [[Category: Programming]] | ||
[[Category: Hardware]] | [[Category: Hardware]] | ||
Revision as of 23:43, 11 June 2012
The official specification for the Generic Keyboard can be found here. The Generic Keyboard is a simple input device compatible with the DCPU-16. It has all the basic ASCII keys including return, backspace, up, down, right and left arrow keys, shift, control, insert and delete.
Hardware details
| Name | Generic Keyboard |
| ID | 0x30cf7406 |
| Version | 1 |
| Manufacturer | Unknown |
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.
Key values
The values for the upper and lower case letters are their values in the ASCII table. Other keys:
| 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 |
| ||||||||

