![]() |
|
Not receiving any input events |
roger levy
Member #2,513
July 2002
|
I'm getting window and timer events but not mouse or keyboard. In my event handler function, I log each event that is not a timer event so I have confirmed this. I think I am setting things up properly. Sorry the code is in Forth. This is called right after creating the window: 1 al_install_mouse drop
2 al_install_keyboard drop
3 al_install_joystick drop
4
5 \ initialize timer and event queue
6
7 1e fps @ s>f f/ al_create_timer to displaytimer
8 al_create_event_queue to eventq
9
10 \ attach event sources
11 eventq displaytimer al_get_timer_event_source al_register_event_source
12 eventq display al_get_display_event_source al_register_event_source
13 eventq al_get_mouse_event_source al_register_event_source
14 eventq al_get_keyboard_event_source al_register_event_source
15 eventq al_get_joystick_event_source al_register_event_source
This bit from the event handler logs events by doing a memory dump on the event struct. It filters out timer events. Only display events are showing up, leaving me scratching my head. e @ ALLEGRO_EVENT_TIMER <> if e 100 idump then My event handler is working fine, AFAIK. Up to this point, I've been getting by with al_get_keyboard_state and al_get_mouse_state but now I would like to use events, particularly ALLEGRO_EVENT_KEY_CHAR. EDIT: |
|