[Main]
Title=How can I get the key repetition feature to work using the keyboard queue?

[Top]
<TABLE CELLPADDING="4"><TR><TD VALIGN="TOP"><B>Q:</B></TD><TD>
Reading directly from the keyboard queue is a good idea, but the key repetition
feature does not work...
</TD></TR><TR><TD VALIGN="TOP"><B>A:</B></TD><TD>
On the first look, it seems that the key repetition feature really
does not work with <A HREF="$$LINK(system.h/OSdequeue)">OSdequeue</A>. But, Marcos
Lopez informed me that this is not exactly true. Key repetition feature
works even with <A HREF="$$LINK(system.h/OSdequeue)">OSdequeue</A>, but it will not
return the keycode itself for the repeated key, but sets an additional
bit in the keycode, so <I>value</I> becomes <I>value</I>&nbsp;+&nbsp;0x800.
If you use standard <A HREF="$$LINK(kbd.h/ngetchx)">ngetchx</A> function, this
additional bit is masked out and your program will get the keycodes it expects.
But, it is very simple to mask out this bit manually and make the key repetition
feature working even with <A HREF="$$LINK(system.h/OSdequeue)">OSdequeue</A>.
</TD></TR></TABLE>
