void kbdputc(Queue *q, int c)
void kbdrepeat(int on)
extern Queue *kbdq;
kbdq = qopen(4*1024, 0, 0, 0); qnoblock(kbdq, 1);
Kbdputc puts a 16-bit Unicode character c (ie, a `rune') on the given q, as a sequence of bytes in UTF-8 encoding (see utf(6)). If c is the special value Latin (defined by keyboard.h), kbdputc starts collecting characters, looking for the typeable representations of Unicode characters defined by keyboard(6); at the end of a complete such sequence, kbdputc queues the UTF-8 encoding of the corresponding Unicode character. It is up to the keyboard driver to map a suitable physical keyboard character (or combination of characters) to the code Latin.
Drivers that need to implement repeat of keypresses in software should call
at the end of kbdinit, to cause kbdclock to be called each clock tick. Kbdrepeat can then be called to enable (on is non-zero) or disable it (on is zero). When repeat is on, kbdclock (when called) will periodically call kbdputc(kbdq,c) where c is the last rune given to kbdputc. The driver is responsible for enabling and disabling repeat appropriately; for instance, function keys and certainly Latin should typically not be repeated.
|KBDPUTC(10.2 )||Rev: Thu Feb 15 14:42:59 GMT 2007|