We're looking for your comments on how to best organize the wiki's content.
(Corrected 'of' to 'off')
|Line 78:||Line 78:|
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.
The Generic Keyboard can perform four interrupts depending on the value of the A register:
|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.
The values for the upper and lower case letters are their values in the ASCII table. Other keys:
|ASCII characters||0x20 to 0x7F|