[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
This is from keyboard.c, from _handle_keypress to be exact.
Is it correct?
if ((keyboard_driver->poll) || (!keyboard_polled)) {
/* If we have a polling function or the keyboard is not in polling
mode, then update the key[] array directly, and call the low level
callback */
}
else {
/* if we do not have a polling function and the keyboard is in polling
mode then put update the _key array, which will be ucopied to
key[] later by a call to poll_keyboard. */
}
The problem I have here is that it seems to be contradiction, but it
works. Probably because it has not been tested with the low level
callbacks, or most likely because keyboard_polled is always correct. The
problem would show up if we had a polling function, but we took the driver
out of polling mode. At least it would show up in my driver because I
planned to kill the keyboard thread, and switch over to pure polling
(which is more efficient they a thread). Other drivers would probably just
keep on updating the key array directly, and the user would never notice
anything wrong unless they where relying on key[] to stay the same between
calls to keyboard_poll().
It seems to be it should be this:
if((keyboard_driver->poll == NULL) || (!keyboard_polled)) {
}
else {
}
Do I get the 'Well Spotted' award?
--
The Phoenix - President of The Artistic Intuition Company
Caelius * Zen-X * Mirror Reflex * Runica * X-Domain * Infinite Realms
http://www.io.com/~fenix