 |
_keytest_optimized |
Function (Macro) |
Optimized low-level keyboard reading for single keys.
_keytest_optimized behaves like _keytest, but
it produces better code if keys from the same row are read sequentially.
You have to use it together with BEGIN_KEYTEST and END_KEYTEST.
An example probably best explains the usage of this function. The following
piece of code waits until an arrow key is pressed. Since all arrows
are in the same row, only one call to _rowread
is necessary.
for (;;)
{
BEGIN_KEYTEST
if (_keytest_optimized (RR_LEFT)
|| _keytest_optimized (RR_RIGHT)
|| _keytest_optimized (RR_UP)
|| _keytest_optimized (RR_DOWN))
break;
END_KEYTEST
}
Uses: _rowread