[AD] X11 keyboard driver missing key up events |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
With the attached test program, if I hold space and move the arrows left
and right a bit, then release keys, the left and/or right arrow KEY_UP
events never come. Here's the output I get (notice the missing UP: 83):
DN: 83
UP: 83
DN: 83
DN: 75
DN: 78
UP: 78
DN: 78
UP: 78
DN: 78
UP: 78
DN: 79
UP: 79
DN: 79
UP: 79
DN: 79
UP: 79
UP: 75
#include <allegro5/allegro.h>
#include <cstdio>
ALLEGRO_EVENT_QUEUE *queue;
void *thread(void *data)
{
while (1) {
ALLEGRO_EVENT e;
if (!al_event_queue_is_empty(queue)) {
al_get_next_event(queue, &e);
if (e.type == ALLEGRO_EVENT_KEY_DOWN)
printf("DN: %d\n", e.keyboard.keycode);
else if (e.type == ALLEGRO_EVENT_KEY_UP)
printf("UP: %d\n", e.keyboard.keycode);
}
al_rest(0.01);
}
return NULL;
}
int main(void)
{
al_init();
al_install_keyboard();
ALLEGRO_DISPLAY *d = al_create_display(640, 480);
queue = al_create_event_queue();
al_register_event_source(queue, al_get_keyboard_event_source());
thread(NULL);
// al_run_detached_thread(thread, NULL);
al_rest(120);
}